Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HttpParams ¶
type HttpParams struct { HttpAddr string `json:"httpAddr" mapstructure:"httpAddr"` HttpsAddr string `json:"httpsAddr" mapstructure:"httpsAddr"` Cert string `json:"cert" mapstructure:"cert"` Key string `json:"key" mapstructure:"key"` AllowOrigin []string `json:"allowOrigin" mapstructure:"allowOrigin"` AllowMethods []string `json:"allowMethods" mapstructure:"allowMethods"` AllowHeaders []string `json:"AllowHeaders" mapstructure:"AllowHeaders"` ExposeHeaders []string `json:"exposeHeaders" mapstructure:"exposeHeaders"` AllowCredentials bool `json:"allowCredentials" mapstructure:"allowCredentials"` MaxAge int `json:"maxAge" mapstructure:"maxAge"` Headers map[string]string `json:"headers" mapstructure:"headers"` AllowOriginHook string `json:"allowOriginHook" mapstructure:"allowOriginHook"` }
type ServerOption ¶
type ServerOption func(*Server)
func WithHeaders ¶
func WithHeaders(headers map[string]string) ServerOption
func WithListener ¶
func WithListener(ln net.Listener) ServerOption
func WithLogger ¶
func WithLogger(logger *logrus.Entry) ServerOption
func WithSSL ¶
func WithSSL(cert, key string) ServerOption
type SignalServer ¶
type SignalServer struct {
// contains filtered or unexported fields
}
func NewSignalServer ¶
func NewSignalServer(ctx context.Context, params HttpParams, logger *logrus.Entry) *SignalServer
func (*SignalServer) AllowHeaders ¶
func (ss *SignalServer) AllowHeaders() []string
func (*SignalServer) AllowMethods ¶
func (ss *SignalServer) AllowMethods() []string
func (*SignalServer) AllowOrigin ¶
func (ss *SignalServer) AllowOrigin() []string
func (*SignalServer) Close ¶
func (ss *SignalServer) Close() error
func (*SignalServer) DefaultRouter ¶
func (ss *SignalServer) DefaultRouter() *gin.Engine
func (*SignalServer) Start ¶
func (ss *SignalServer) Start(handles ...gin.HandlerFunc) error
Click to show internal directories.
Click to hide internal directories.