web

package
v2.2.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMainCommand added in v2.0.24

func NewMainCommand(engine *WebEngine) *cobra.Command

Types

type EndpointDeclaration

type EndpointDeclaration interface {
	Apply(appContext context.Context, target *gin.RouterGroup)
}

type GroupDeclaration

type GroupDeclaration struct {
	// contains filtered or unexported fields
}

func (*GroupDeclaration) Apply

func (g *GroupDeclaration) Apply(appContext context.Context, target *gin.RouterGroup)

func (*GroupDeclaration) RegisterEndpoint

func (g *GroupDeclaration) RegisterEndpoint(method string, roles []string, handlers ...gin.HandlerFunc)

func (*GroupDeclaration) RegisterEndpointPath

func (g *GroupDeclaration) RegisterEndpointPath(method string, relativePath string, roles []string, handlers ...gin.HandlerFunc)

func (*GroupDeclaration) RegisterGroup

func (g *GroupDeclaration) RegisterGroup(relativePath string, roles []string) *GroupDeclaration

type WebEngine

type WebEngine struct {
	context.Context

	GroupDeclaration
	// contains filtered or unexported fields
}

func NewWebEngine

func NewWebEngine(ctx context.Context) *WebEngine

func WebEngineFromContext

func WebEngineFromContext(ctx context.Context) *WebEngine

func (*WebEngine) Start

func (s *WebEngine) Start() error

Start sets a supply of env vars to work with into gin context (when it gets deployed by ai-provisioner / deployment server within DSP)

  • JWT_ISSUER the token ISSUER that will be used to validate all provided tokens (i.e. https://auth.tiki-dsp.io/auth/realms/tiki)

  • OAUTH_CLIENT_ID the client that will be used to validate all provided tokens (i.e. ai-examples-python-dev-web-py36)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL