Documentation ¶
Index ¶
- Constants
- func NewGatewayMixin(start GatewayMixin) nucleo.Mixin
- type AuthenticateMethodsFunc
- type AuthorizeMethodFunc
- type GatewayMixin
- type GatewayService
- func (svc *GatewayService) Created(schema nucleo.ServiceSchema, logger *log.Entry)
- func (svc *GatewayService) Dependencies() []string
- func (svc *GatewayService) Metadata() map[string]interface{}
- func (svc GatewayService) Name() string
- func (svc *GatewayService) Started(context nucleo.BrokerContext, schema nucleo.ServiceSchema)
- func (svc *GatewayService) Stopped(context nucleo.BrokerContext, service nucleo.ServiceSchema)
- type MappingPolicyType
- type Route
Constants ¶
View Source
const ( LIBRARY_NAME = "nucleo-gateway" LIBRARY_VERSION = "0.1.0" LIBRARY_REPOSITORY = "https://github.com/Bendomey/awesome-gateway" MappingPolicyAll MappingPolicyType = "all" MappingPolicyRestrict MappingPolicyType = "restrict" )
Variables ¶
This section is empty.
Functions ¶
func NewGatewayMixin ¶
func NewGatewayMixin(start GatewayMixin) nucleo.Mixin
Types ¶
type AuthenticateMethodsFunc ¶
type AuthorizeMethodFunc ¶
type GatewayMixin ¶
type GatewayMixin struct { Authenticate *AuthenticateMethodsFunc Authorize *AuthorizeMethodFunc }
type GatewayService ¶
type GatewayService struct { Authenticate *AuthenticateMethodsFunc Authorize *AuthorizeMethodFunc // contains filtered or unexported fields }
func (*GatewayService) Created ¶
func (svc *GatewayService) Created(schema nucleo.ServiceSchema, logger *log.Entry)
func (*GatewayService) Dependencies ¶
func (svc *GatewayService) Dependencies() []string
func (*GatewayService) Metadata ¶
func (svc *GatewayService) Metadata() map[string]interface{}
func (GatewayService) Name ¶
func (svc GatewayService) Name() string
func (*GatewayService) Started ¶
func (svc *GatewayService) Started(context nucleo.BrokerContext, schema nucleo.ServiceSchema)
func (*GatewayService) Stopped ¶
func (svc *GatewayService) Stopped(context nucleo.BrokerContext, service nucleo.ServiceSchema)
type MappingPolicyType ¶
type MappingPolicyType string
type Route ¶
type Route struct { // Name of the route group Name string // Path of the route group Path string // Route-level middlewares. Use []gin.HandlerFunc //whitelist filter used to filter the list of actions. //accept regex, and wildcard on action name //regex: /^math\.\w+$/ //wildcard: posts.* Whitelist []string //mappingPolicy -> all : include all actions, the ones with aliases and without. //mappingPolicy -> restrict : include only actions that are in the list of aliases. MappingPolicy MappingPolicyType //aliases -> alias names instead of action names. Aliases map[string]string // This is called before action is called OnBeforeCall *func(context nucleo.Context, ginContext *gin.Context, route Route, alias string) // This is called after action is called but before response is sent to user. OnAfterCall *func(context nucleo.Context, ginContext *gin.Context, route Route, response nucleo.Payload) //authorization turn on/off authorization Authorization bool //authentication turn on/off authentication Authentication bool }
Click to show internal directories.
Click to hide internal directories.