modulepackage
0.0.0-20200618101853-2f00c417fbc8
Repository: https://github.com/itross/sgul.git
Documentation: pkg.go.dev
# README
SGUL - Simple Golang Utils & Libs
# Packages
No description provided by the author
# Functions
BalancerFor returns the load balancer instance for the requested strategy.
ContainsString checks if a slice of strings contains a string.
Get returns a configuration map by key.
GetComponentConfig returns default config structure for a default component name.
GetConfiguration returns the Configuration structure singleton instance.
GetLogger .
GetLoggerByConf .
GetPage return the pager struct from request Context.
GetPrincipal return the user authenticated Princiapl information from the request context.
IsSet checks to see if the key has been set in any of the data locations.
JWTAuthorizer is the JWT authentication middleware to use on mux (a.
JWTRouteAuthorizer is the JWT authentication middleware to use on single route (a.e.
LoadConfiguration reads the configuration file according to the ENV var and return unmarshalled struct.
MaskedStringify converts a struct to its string representation obfuscating values for keys in the mask slice.
MergeStringSlices merges string slices avoiding duplicates.
NewAMQPConnection return a new disconnected AMQP Connection structure.
NewAMQPPublisher return a new AMQP Publisher object.
NewAMQPSubscriber returns a new AMQP Subscriber object.
NewCasbinEnforcer .
NewController return a new instance of Controller (useful in composition for api controllers).
NewEvent return a new Event instance.
NewHTTPError returns a new HTTPError instance.
NewMatchRoleEnforcer returns a new MathRoleEnforcer instance.
NewREGAgent returns a new REGAgent instance.
NewRepository returns a new Repository instance.
NewShamClient returns a new Sham client instance bounded to a service.
Pager is the query paging middleware.
RandomBalander returns the random balancer instance.
RegisterService is an helper to register a service with the SgulREG service.
RenderError exported to be used in this lib (a.e.
RoundRobinBalancer returns the round-robin balancer instance.
RoutePager is the query paging middleware to be used on routes.
Stringify converts a struct to its string representation.
# Constants
RandomStrategy is the random balancing strategy name.
RoundRobinStrategy is the round robin balancing strategy name.
# Variables
ErrFailedDiscoveryRequest is returned when a discovery request fails.
ErrFailedDiscoveryResponseBody is returned if the discovery client is unable to read http response body.
ErrPagerNotInContext is returned if there is no Pager in the request context.
ErrPrincipalNotInContext is returned if there is no Principal in the request context.
# Structs
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
CasbinEnforcer .
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Event is the struct used to push event messages into AMQP queues.
No description provided by the author
GormRepository defines the base repository structure form gorm based db access.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
MatchAllEnforcer is the match all rules;routes enforcer.
MatchRoleEnforcer authorize user only if it's role is in roles.
Page defines the struct with paging info to send into the request context.
Principal defines the struct registered into the Context representing the authenticated user information from the JWT Token.
No description provided by the author
No description provided by the author
REGAgent is the Agent used by a service to register its instance with the SgulREG Service Registry.
No description provided by the author
No description provided by the author
ShamClient defines the struct for a sham client to an http endpoint.
No description provided by the author
# Interfaces
No description provided by the author
No description provided by the author
No description provided by the author
GormRepositoryInterface is the contract for a Gorm Repository.
No description provided by the author
RolesEnforcer is the user roles enforcer for gain user access to resources.
# Type aliases
InTransaction defines the func type to be executed in a gorm transaction.
Logger is a type alias for Zap sugared logger We love Zap, we use Zap and we will continue using it forever!.