application

package
v1.7.5 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPHeadersCrossOrigin

func HTTPHeadersCrossOrigin() func() map[string]string

func New

func New(appConf *AppConfig, swaggerConf *SwaggerConf, ctx context.Context) rest.IApplication

Types

type AppConfig

type AppConfig struct {
	SSL                bool
	Addr               string
	Http               bool
	Websocket          bool
	Secret             []byte
	HttpPrefix         string
	WebsocketPrefix    string
	HTTPHeaders        func() map[string]string
	Commands           func(string) (rest.IExecuter, bool)
	TLSKeyPath         string
	TLSCertPath        string
	Core               any
	OnSocketConnect    func(rest.IStream)
	OnSocketDisconnect func(rest.IStream)
}

func (*AppConfig) GetHTTPHeaders

func (s *AppConfig) GetHTTPHeaders() func() map[string]string

func (*AppConfig) GetHttpPrefix

func (s *AppConfig) GetHttpPrefix() string

func (*AppConfig) GetWebsocketPrefix

func (s *AppConfig) GetWebsocketPrefix() string

type Application

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

func (*Application) Connect

func (s *Application) Connect() chan<- rest.IStream

func (*Application) Executer

func (s *Application) Executer(r rest.IRequestIn) (rest.IExecuter, bool)

func (*Application) Stop

func (s *Application) Stop()

type Swagger

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

func NewSwagger

func NewSwagger(conf *SwaggerConf) *Swagger

func (*Swagger) Start

func (s *Swagger) Start(ctx context.Context)

func (*Swagger) Stop

func (s *Swagger) Stop()

type SwaggerConf

type SwaggerConf struct {
	Enabled     bool
	Addr        string
	URI         string
	Prefix      string
	SSL         bool
	TLSKeyPath  string
	TLSCertPath string
}

Jump to

Keyboard shortcuts

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