server

package
v0.0.0-...-ba64992 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewApiResponsePayload

func NewApiResponsePayload(requestPayload *api_proto.Payload) *api_proto.Payload

Types

type Authentication

type Authentication interface {
	GetTenantId() string
	GetAccountId() string
	CheckSubscribeTopic(topic string) bool
}

type ClientContext

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

func (*ClientContext) CheckSubscribeTopic

func (c *ClientContext) CheckSubscribeTopic(topic string) bool

func (*ClientContext) GetAccountId

func (c *ClientContext) GetAccountId() string

func (*ClientContext) GetAuthentication

func (c *ClientContext) GetAuthentication() Authentication

func (*ClientContext) GetTenantId

func (c *ClientContext) GetTenantId() string

func (*ClientContext) SetAuthentication

func (c *ClientContext) SetAuthentication(authentication Authentication)

type ErrorBody

type ErrorBody struct {
	Message string `json:"message"`
}

type Option

type Option struct {
	Context context.Context

	PublicPort  int
	ClusterPort int
	PrivatePort int
	ContextPath string
	MetricsPath string

	MongoUri      string
	MongoUsername string
	MongoPassword string

	PeerNotifyAddress string

	// SmtpServer address:port
	SmtpServer      string
	SmtpUsername    string
	SmtpPassword    string
	MailFrom        string
	MailFromName    string
	MailFromAddress string

	BrokerUri              string
	BrokerUsername         string
	BrokerPassword         string
	BrokerRoutingKeyPrefix string

	PublicApp  *fiber.App
	PrivateApp *fiber.App

	WebsocketInterceptor WebsocketInterceptor
	PublicApiInterceptor PublicApiInterceptor
	I18nReLoader         template_service.I18nReLoader

	LocaleFallback string
}

type PeerItem

type PeerItem struct {
	Id            string `json:"id"`
	State         string `json:"state"`
	RemoteAddress string `json:"remoteAddress"`
}

type PublicApiInterceptor

type PublicApiInterceptor func(c *fiber.Ctx, clientContext *ClientContext) error

type Server

type Server struct {
	PublicApp  *fiber.App
	PrivateApp *fiber.App
	// contains filtered or unexported fields
}

func NewServer

func NewServer(option *Option) (*Server, error)

func (*Server) FiberServe

func (s *Server) FiberServe() error

func (*Server) Option

func (s *Server) Option() Option

Option read-only

func (*Server) PeerService

func (s *Server) PeerService() peer_service.PeerService

func (*Server) PubSubService

func (s *Server) PubSubService() pubsub_service.PubSubService

func (*Server) Start

func (s *Server) Start() error

func (*Server) Stop

func (s *Server) Stop()

type WebSocketConnection

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

func (*WebSocketConnection) ClientContext

func (c *WebSocketConnection) ClientContext() *ClientContext

func (*WebSocketConnection) RawConn

func (c *WebSocketConnection) RawConn() *websocket.Conn

type WebSocketRequestHandler

type WebSocketRequestHandler func(c *WebSocketConnection, payload *api_proto.Payload) (*api_proto.Payload, error)

type WebsocketInterceptor

type WebsocketInterceptor func(c *WebSocketConnection) error

Directories

Path Synopsis
api
service

Jump to

Keyboard shortcuts

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