application

package
v1.20.12 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: MIT Imports: 13 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) GetCommandsMethod added in v1.12.0

func (s *AppConfig) GetCommandsMethod() func(string) (rest.IExecuter, bool)

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 {
	*Sockets
	// contains filtered or unexported fields
}

func (*Application) Executer

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

func (*Application) Stop

func (s *Application) Stop()

type Sockets added in v1.18.0

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

func NewSockets added in v1.18.0

func NewSockets() *Sockets

func (*Sockets) ClientAuth added in v1.18.0

func (s *Sockets) ClientAuth(id any, stream rest.IStream)

func (*Sockets) ClientExists added in v1.18.0

func (s *Sockets) ClientExists(id any) bool

func (*Sockets) Connect added in v1.18.0

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

func (*Sockets) OnlineCount added in v1.18.0

func (s *Sockets) OnlineCount() int64

func (*Sockets) SendMessage added in v1.18.0

func (s *Sockets) SendMessage(id any, message rest.IRequestOut)

type StreamStore added in v1.18.0

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

func NewStreamStore added in v1.18.0

func NewStreamStore(stream rest.IStream) *StreamStore

func (*StreamStore) SendMessage added in v1.18.0

func (s *StreamStore) SendMessage(message rest.IRequestOut)

func (*StreamStore) Size added in v1.18.0

func (s *StreamStore) Size() int

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