Documentation
¶
Index ¶
- Variables
- func JWTMiddleware(jwtSecret string, adminOnly bool) gin.HandlerFunc
- func NewAPIGateway(jwtSecret string) *gin.Engine
- func NewGatewayAdminAPI(secret string, tokenExpiry int) *gin.Engine
- func SetCorsHeaders(response http.ResponseWriter, request *http.Request)
- func SetProxyHeaders(request *http.Request, url *url.URL)
- type GraphPersistence
- type JWTClaims
- type Module
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // define custom errors returned by application ErrInvalidJWToken = errors.New("Invalid JWToken") ErrInvalidTokenSchema = errors.New("Invalid Token Schema") ErrInvalidAuthHeader = errors.New("Invalid authorization header") )
View Source
var ( // define custom errors ErrInvalidModule = errors.New("Module does not exist") ErrModuleExists = errors.New("Module already exists") )
Functions ¶
func JWTMiddleware ¶
func JWTMiddleware(jwtSecret string, adminOnly bool) gin.HandlerFunc
middleware used to parse JWTokens from request
func NewAPIGateway ¶
function used to generate new API gateway service
func NewGatewayAdminAPI ¶
function used to generate new API gateway admin service
func SetCorsHeaders ¶
func SetCorsHeaders(response http.ResponseWriter, request *http.Request)
function used to set CORS headers on incoming requests
Types ¶
type GraphPersistence ¶
type GraphPersistence struct {
*utils.BaseGraphAccessor
}
func NewGraphPersistence ¶
func NewGraphPersistence(host string, port int, username, password string) (*GraphPersistence, error)
func SetGraphPersistence ¶
func SetGraphPersistence(host string, port int, username, password string) *GraphPersistence
function used to set new instance of graph persistence for global variables to use
func (*GraphPersistence) AddModule ¶
func (db *GraphPersistence) AddModule(module Module) error
function used to add a new module to the graph. note that all module lables are constrained so that the module name must be unique to avoid duplicate modules
func (*GraphPersistence) GetModuleDetails ¶
func (db *GraphPersistence) GetModuleDetails(name string) (Module, error)
function used to retrieve module details from graph
Click to show internal directories.
Click to hide internal directories.