web_server

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WebHandleWrapper

func WebHandleWrapper(handler WebHandler, newRequestFunc NewWebRequestFunc) gin.HandlerFunc

Types

type CreateDbRequest

type CreateDbRequest struct {
	*sourceApi.DatabaseRequest
}

func (*CreateDbRequest) AuthRequired

func (r *CreateDbRequest) AuthRequired() bool

func (*CreateDbRequest) GetName

func (r *CreateDbRequest) GetName() string

func (*CreateDbRequest) Process

func (r *CreateDbRequest) Process(c *gin.Context, handler WebHandler)

func (*CreateDbRequest) Resources

func (r *CreateDbRequest) Resources() []string

func (*CreateDbRequest) Scopes

func (r *CreateDbRequest) Scopes() []string

type DbHandler

type DbHandler struct {
	SourceHandler sourceApi.SourceHandler
	ReadyWaiter   grpcServerApi.DbReadyWaiter
}

func NewDbHandler

func NewDbHandler(sourceHandler sourceApi.SourceHandler, readyWaiter grpcServerApi.DbReadyWaiter) *DbHandler

func (*DbHandler) GetName

func (h *DbHandler) GetName() string

type IsDbReadyRequest

type IsDbReadyRequest struct {
	Name         string `form:"name" json:"name" binding:"max=63,id"`
	InstanceName string `form:"instance_name" json:"instance_name" binding:"max=63,iname"`
}

func (*IsDbReadyRequest) AuthRequired

func (r *IsDbReadyRequest) AuthRequired() bool

func (*IsDbReadyRequest) GetName

func (r *IsDbReadyRequest) GetName() string

func (*IsDbReadyRequest) Process

func (r *IsDbReadyRequest) Process(c *gin.Context, handler WebHandler)

func (*IsDbReadyRequest) Resources

func (r *IsDbReadyRequest) Resources() []string

func (*IsDbReadyRequest) Scopes

func (r *IsDbReadyRequest) Scopes() []string

type NewWebRequestFunc

type NewWebRequestFunc func() WebRequest

type WebHandler

type WebHandler interface {
	GetName() string
}

type WebRequest

type WebRequest interface {
	GetName() string

	Scopes() []string
	Resources() []string
	AuthRequired() bool

	Process(c *gin.Context, handler WebHandler)
}

func NewCreateDbRequest

func NewCreateDbRequest() WebRequest

func NewIsDbReadyRequest

func NewIsDbReadyRequest() WebRequest

type WebServer

type WebServer struct {
	Config *config.WebConfig

	Server *http.Server
	Router *gin.Engine
	Auth   *ginAuth.GinAuth
	// contains filtered or unexported fields
}

func NewWebServer

func NewWebServer(config *config.WebConfig) *WebServer

func (*WebServer) Init

func (w *WebServer) Init(setter server.GlobalSetter) error

func (*WebServer) PostInit

func (w *WebServer) PostInit(getter server.GlobalGetter) error

func (*WebServer) Run

func (w *WebServer) Run()

func (*WebServer) Shutdown

func (w *WebServer) Shutdown(ctx context.Context)

Jump to

Keyboard shortcuts

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