types

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CLIENT_GRPC_NAME = "lets-service"
	CLIENT_GRPC_HOST = "127.0.0.1"
	CLIENT_GRPC_PORT = "5100"
)

Default grpc configuration

View Source
const (
	SERVER_HTTP_PORT = "5000"
	SERVER_HTTP_MODE = "debug"
)

Default gRPC configuration

View Source
const (
	MONGODB_DSN      = "mongodb://localhost:27017"
	MONGODB_DATABASE = "default"
)
View Source
const (
	MYSQL_DB_HOST       = "localhost"
	MYSQL_DB_PORT       = "3306"
	MYSQL_DB_USERNAME   = "root"
	MYSQL_DB_PASSWORD   = ""
	MYSQL_DB_DATABASE   = "lets"
	MYSQL_DB_CHARSET    = "utf8"
	MYSQL_DB_PARSE_TIME = "True"
	MYSQL_DB_LOC        = "Local"
	MYSQL_DB_MIGRATION  = false
)
View Source
const (
	LISTEN_RABBIT_NAME          = "Default Manager"
	LISTEN_RABBIT_VHOST         = "/"
	LISTEN_RABBIT_EXCHANGE      = ""
	LISTEN_RABBIT_EXCHANGE_TYPE = amqp091.ExchangeDirect
	LISTEN_RABBIT_ROUTING_KEY   = ""
	LISTEN_RABBIT_QUEUE         = ""
	LISTEN_RABBIT_DEBUG         = true
)

Default configuration

View Source
const (
	RQ_USERNAME = "guest"
	RQ_PASSWORD = "guest"
	RQ_HOST     = "localhost"
	RQ_PORT     = "5672"
	RQ_VHOST    = "/"
)

Default configuration

View Source
const (
	CALLER_RABBIT_NAME_EXAMPLE     = "default-name"
	CALLER_RABBIT_EXCHANGE_EXAMPLE = "default-exchange"
	CALLER_RABBIT_DEBUG_EXAMPLE    = false
)

Default configuration

View Source
const (
	RABBIT_HOST     = "localhost"
	RABBIT_PORT     = "5672"
	RABBIT_USERNAME = "guest"
	RABBIT_PASSWORD = "guest"
	RABBIT_VHOST    = "/"
)

Default configuration

View Source
const (
	REDIS_HOST     = "localhost"
	REDIS_PORT     = "6379"
	REDIS_USERNAME = ""
	REDIS_PASSWORD = ""
	REDIS_DATABASE = 0
)
View Source
const (
	CLIENT_TCP_NAME = "lets-connect-tcp"
	CLIENT_TCP_HOST = "127.0.0.1"
	CLIENT_TCP_PORT = "5050"
	CLIENT_TCP_MODE = "debug"
)

Default grpc configuration

View Source
const (
	SERVER_TCP_PORT = "5050"
	SERVER_TCP_MODE = "debug"
)

Default gRPC configuration

View Source
const (
	SERVER_WS_PORT = "5050"
	SERVER_WS_MODE = "debug"
)

Default gRPC configuration

View Source
const (
	SERVER_GRPC_PORT = "5100"
)

Default grpc server configuration

Variables

View Source
var (
	ErrNotImplemented = errors.New("not implemented function")
	ErrCantCreate     = errors.New("cant create")
)

Functions

This section is empty.

Types

type Engine

type Engine interface {
	Event(string, func(*Event))
	Call(string, *Event)
}

Engine for controller

type Environment

type Environment struct {
	Name  string
	Debug string
}

Serve information

func (*Environment) GetDebug

func (e *Environment) GetDebug() string

func (*Environment) GetName

func (e *Environment) GetName() string

type Event

type Event struct {
	Name          string
	Exchange      string // Service exchange.
	RoutingKey    string // Service routing key.
	Data          interface{}
	ReplyTo       IReplyTo
	CorrelationId string
	Debug         bool
	Body          IRabbitBody
}

func (*Event) GetBody

func (m *Event) GetBody() []byte

func (*Event) GetCorrelationId

func (m *Event) GetCorrelationId() string

func (*Event) GetData

func (m *Event) GetData() interface{}

func (*Event) GetDebug

func (m *Event) GetDebug() bool

func (*Event) GetExchange

func (m *Event) GetExchange() string

func (*Event) GetName

func (m *Event) GetName() string

func (*Event) GetReplyTo

func (m *Event) GetReplyTo() IReplyTo

func (*Event) GetRoutingKey

func (m *Event) GetRoutingKey() string

func (*Event) NilBody

func (m *Event) NilBody() bool

type GrpcClient

type GrpcClient struct {
	Name          string
	Host          string
	Port          string
	ClientOptions []grpc.DialOption
	Clients       []IGrpcServiceClient
}

Client information

func (*GrpcClient) GetClientOptions

func (gc *GrpcClient) GetClientOptions() []grpc.DialOption

Get Client Option

func (*GrpcClient) GetClients

func (gc *GrpcClient) GetClients() []IGrpcServiceClient

Get Clients

func (*GrpcClient) GetHost

func (gc *GrpcClient) GetHost() string

Get Host

func (*GrpcClient) GetName

func (gc *GrpcClient) GetName() string

Get Name

func (*GrpcClient) GetPort

func (gc *GrpcClient) GetPort() string

Get Port

type GrpcConfig

type GrpcConfig struct {
	Server  IGrpcServer
	Clients []IGrpcClient
}

GRPC configuration struct

func (*GrpcConfig) GetClients

func (g *GrpcConfig) GetClients() []IGrpcClient

Get gRPC client configuration

func (*GrpcConfig) GetServer

func (g *GrpcConfig) GetServer() IGrpcServer

Get gRPC server configuration

type GrpcServer

type GrpcServer struct {
	Port          string
	Router        func(*grpc.Server)
	ServerOptions []grpc.ServerOption
}

Server information

func (*GrpcServer) GetPort

func (g *GrpcServer) GetPort() string

Get Port

func (*GrpcServer) GetRouter

func (g *GrpcServer) GetRouter() func(*grpc.Server)

Get Router

func (*GrpcServer) GetServerOptions

func (g *GrpcServer) GetServerOptions() []grpc.ServerOption

Get Router

type HttpServer

type HttpServer struct {
	Port       string
	Middleware func(*gin.Engine)
	Router     func(*gin.Engine)
	Gzip       bool
	Mode       string
}

Serve information

func (*HttpServer) GetGzip

func (hs *HttpServer) GetGzip() bool

Get Gzip

func (*HttpServer) GetMiddleware

func (hs *HttpServer) GetMiddleware() func(*gin.Engine)

Get Middleware

func (*HttpServer) GetMode

func (hs *HttpServer) GetMode() string

Get Mode

func (*HttpServer) GetPort

func (hs *HttpServer) GetPort() string

Get Port

func (*HttpServer) GetRouter

func (hs *HttpServer) GetRouter() func(*gin.Engine)

Get Router

type IEnvironment

type IEnvironment interface {
	GetName() string
	GetDebug() string
}

type IEvent

type IEvent interface {
	GetName() string
	GetData() interface{}
	GetReplyTo() IReplyTo
	GetCorrelationId() string
	GetExchange() string
	GetRoutingKey() string
	GetBody() []byte
	GetDebug() bool
}

type IFrameworkRabbitMQPublisher

type IFrameworkRabbitMQPublisher interface {
	Publish(IEvent) error
}

type IGrpcClient

type IGrpcClient interface {
	GetName() string
	GetHost() string
	GetPort() string
	GetClientOptions() []grpc.DialOption
	GetClients() []IGrpcServiceClient
}

Interface for grpc method

type IGrpcConfig

type IGrpcConfig interface {
	GetServer() IGrpcServer
	GetClients() []IGrpcClient
}

GRPC configuration interface

type IGrpcServer

type IGrpcServer interface {
	GetPort() string
	GetRouter() func(*grpc.Server)
	GetServerOptions() []grpc.ServerOption
}

Interface for gRPC

type IGrpcServiceClient

type IGrpcServiceClient interface {
	SetConnection(*grpc.ClientConn)
}

type IHttpServer

type IHttpServer interface {
	GetPort() string
	GetMode() string
	GetMiddleware() func(*gin.Engine)
	GetRouter() func(*gin.Engine)
	GetGzip() bool
}

Interface for accessable method

type IMongoDB

type IMongoDB interface {
	GetDsn() string
	GetDatabase() string
	GetRepositories() []IMongoDBRepository
}

type IMongoDBRepository

type IMongoDBRepository interface {
	SetDriver(*mongo.Database)
}

type IMySQL

type IMySQL interface {
	GetHost() string
	GetPort() string
	GetUsername() string
	GetPassword() string
	GetDatabase() string
	GetCharset() string
	GetParseTime() string
	GetLoc() string
	DebugMode() bool
	GetRepositories() []IMySQLRepository
	GetDsn() string
	Migration() bool
	GetQueryFields() bool
	GetDisableNestedTransaction() bool
}

type IMySQLRepository

type IMySQLRepository interface {
	SetDriver(*gorm.DB, *sync.RWMutex)
}

type IRabbitBody

type IRabbitBody interface {
	SetEvent(string)
	SetData(interface{})
	GetEvent() string
	GetData() interface{}
	Setup()
}

type IRabbitMQConfig

type IRabbitMQConfig interface {
	GetServers() []IRabbitMQServer
}

type IRabbitMQConsumer

type IRabbitMQConsumer interface {
	GetName() string
	GetExchange() string
	GetExchangeType() string
	GetRoutingKey() string
	GetQueue() string
	GetDebug() bool
	GetListener() func(Engine)
	GenerateReplyTo() ReplyTo
	GetBody() IRabbitBody
}

Interface for dsn accessable method

type IRabbitMQDsn

type IRabbitMQDsn interface {
	GetHost() string
	GetPort() string
	GetUsername() string
	GetPassword() string
	GetVirtualHost() string
}

Interface for dsn accessable method

type IRabbitMQPublisher

type IRabbitMQPublisher interface {
	GetName() string
	GetClients() []IRabbitMQServiceClient
}

Interface for dsn accessable method

type IRabbitMQServer

type IRabbitMQServer interface {
	GetHost() string
	GetPort() string
	GetUsername() string
	GetPassword() string
	GetVHost() string
	GetConsumers() []IRabbitMQConsumer
	GetPublishers() []IRabbitMQPublisher
	GetAutoAck() bool
}

type IRabbitMQServiceClient

type IRabbitMQServiceClient interface {
	SetConnection(IFrameworkRabbitMQPublisher)
}

type IRedis

type IRedis interface {
	GetHost() string
	GetPort() string
	GetUsername() string
	GetPassword() string
	GetDatabase() int
	GetDsn() string
	// DebugMode() bool
	GetRepositories() []IRedisRepository
}

type IRedisRepository

type IRedisRepository interface {
	SetDriver(*redis.Client)
}

type IReplyTo

type IReplyTo interface {
	SetRoutingKey(string)
	Get() string
}

type ITcpClient

type ITcpClient interface {
	GetName() string
	GetHost() string
	GetPort() string
	GetMode() string
	GetClients() []ITcpServiceClient
}

Interface for grpc method

type ITcpConfig

type ITcpConfig interface {
	GetServers() []ITcpServer
	GetClients() []ITcpClient
}

GRPC configuration interface

type ITcpServer

type ITcpServer interface {
	GetPort() string
	GetMode() string
	GetHandler() ITcpServiceHandler
}

Interface for accessable method

type ITcpServiceClient

type ITcpServiceClient interface {
	OnConnect()
	OnDisconnect()
}

type ITcpServiceHandler

type ITcpServiceHandler interface {
	OnConnect()
	OnDisconnect()
}

type IWebSocketBody

type IWebSocketBody interface {
	SetAction(string)
	SetData(interface{})
	GetAction() string
	GetData() interface{}
	Setup()
}

type IWebSocketEvent

type IWebSocketEvent interface {
	GetConnection() *websocket.Conn
	GetName() string
	GetData() interface{}
	GetBody() []byte
	GetDebug() bool
}

type IWebSocketEventHandler

type IWebSocketEventHandler interface {
	Event(string, func(IWebSocketEvent))
	Call(string, IWebSocketEvent)
}

Engine for controller

type IWebSocketRoute

type IWebSocketRoute interface {
	Initialize(*gin.Engine, bool)
}

type IWebSocketServer

type IWebSocketServer interface {
	GetPort() string
	GetMode() string
	GetRoutes() []IWebSocketRoute
}

Interface for accessable method

type IdentityNetwork added in v1.4.7

type IdentityNetwork struct {
	Hostname     []string `desc:"Hostname"`
	IPV4         []net.IP `desc:"IPV4 Address"`
	IPV6         []net.IP `desc:"IPV6 Address"`
	NetInterface []string `desc:"Network Interface"`
}

type IdentityService

type IdentityService struct {
	Name        string
	Description string
	ServiceDns  string `desc:"Service DNS"`
	Layer       string `desc:"Microservice Layer"`
	Author      string
}

Serve information

type IdentitySource

type IdentitySource struct {
	Repository    string `desc:"Repository URL"`
	Documentation string `desc:"Documentation URL"`
}

type MongoDB

type MongoDB struct {
	Dsn          string
	Database     string
	Repositories []IMongoDBRepository
}

func (*MongoDB) GetDatabase

func (r *MongoDB) GetDatabase() string

func (*MongoDB) GetDsn

func (r *MongoDB) GetDsn() string

func (*MongoDB) GetRepositories

func (r *MongoDB) GetRepositories() []IMongoDBRepository

type MySQL

type MySQL struct {
	Host                     string
	Port                     string
	Username                 string
	Password                 string
	Database                 string
	Charset                  string
	ParseTime                string
	Loc                      string
	Debug                    bool
	Gorm                     *gorm.DB
	DB                       *sql.DB
	Repositories             []IMySQLRepository
	EnableMigration          bool
	QueryFields              bool
	DisableNestedTransaction bool
}

func (*MySQL) DebugMode

func (mysql *MySQL) DebugMode() bool

func (*MySQL) GetCharset

func (mysql *MySQL) GetCharset() string

func (*MySQL) GetDatabase

func (mysql *MySQL) GetDatabase() string

func (*MySQL) GetDisableNestedTransaction added in v1.4.4

func (mysql *MySQL) GetDisableNestedTransaction() bool

func (*MySQL) GetDsn

func (mysql *MySQL) GetDsn() string

func (*MySQL) GetHost

func (mysql *MySQL) GetHost() string

func (*MySQL) GetLoc

func (mysql *MySQL) GetLoc() string

func (*MySQL) GetParseTime

func (mysql *MySQL) GetParseTime() string

func (*MySQL) GetPassword

func (mysql *MySQL) GetPassword() string

func (*MySQL) GetPort

func (mysql *MySQL) GetPort() string

func (*MySQL) GetQueryFields added in v1.4.4

func (mysql *MySQL) GetQueryFields() bool

func (*MySQL) GetRepositories

func (mysql *MySQL) GetRepositories() []IMySQLRepository

func (*MySQL) GetUsername

func (mysql *MySQL) GetUsername() string

func (*MySQL) Migration

func (mysql *MySQL) Migration() bool

type RabbitBody

type RabbitBody struct {
	Payload interface{}
	Event   string      `json:"event"`
	Data    interface{} `json:"data"`
}

func (*RabbitBody) GetData

func (rb *RabbitBody) GetData() interface{}

Get Data API

func (*RabbitBody) GetEvent

func (rb *RabbitBody) GetEvent() string

Get Event Name

func (*RabbitBody) SetData

func (rb *RabbitBody) SetData(data interface{})

Set Data API

func (*RabbitBody) SetEvent

func (rb *RabbitBody) SetEvent(event string)

Set Event Name

func (*RabbitBody) Setup

func (rb *RabbitBody) Setup()

type RabbitMQConfig

type RabbitMQConfig struct {
	Servers []IRabbitMQServer
}

func (*RabbitMQConfig) GetServers

func (r *RabbitMQConfig) GetServers() []IRabbitMQServer

type RabbitMQConsumer

type RabbitMQConsumer struct {
	Name          string `json:"name"`
	Exchange      string `json:"exchange"`
	ExchangeType  string `json:"type"`
	RoutingKey    string `json:"routing_key"`
	Queue         string `json:"queue"`
	Debug         string `json:"debug"`
	Listener      func(Engine)
	CustomPayload IRabbitBody `json:"custom_payload"`
}

Target host information.

func (*RabbitMQConsumer) GenerateReplyTo

func (r *RabbitMQConsumer) GenerateReplyTo() (replyTo ReplyTo)

Generating reply to payload.

func (*RabbitMQConsumer) GetBody

func (r *RabbitMQConsumer) GetBody() IRabbitBody

Get payload structure for received message.

func (*RabbitMQConsumer) GetDebug

func (r *RabbitMQConsumer) GetDebug() bool

Get Debug.

func (*RabbitMQConsumer) GetExchange

func (r *RabbitMQConsumer) GetExchange() string

Get Exchange.

func (*RabbitMQConsumer) GetExchangeType

func (r *RabbitMQConsumer) GetExchangeType() string

Get Exchange Type.

func (*RabbitMQConsumer) GetListener

func (r *RabbitMQConsumer) GetListener() func(Engine)

Get Listener.

func (*RabbitMQConsumer) GetName

func (r *RabbitMQConsumer) GetName() string

Get Name.

func (*RabbitMQConsumer) GetQueue

func (r *RabbitMQConsumer) GetQueue() string

Get Queue.

func (*RabbitMQConsumer) GetRoutingKey

func (r *RabbitMQConsumer) GetRoutingKey() string

Get Routing Key.

type RabbitMQDsn

type RabbitMQDsn struct {
	Host, Port, Username, Password, VirtualHost string
}

Target host information.

func (*RabbitMQDsn) GetHost

func (rtm *RabbitMQDsn) GetHost() string

Get Host.

func (*RabbitMQDsn) GetPassword

func (rtm *RabbitMQDsn) GetPassword() string

Get Password.

func (*RabbitMQDsn) GetPort

func (rtm *RabbitMQDsn) GetPort() string

Get Port.

func (*RabbitMQDsn) GetUsername

func (rtm *RabbitMQDsn) GetUsername() string

Get Username.

func (*RabbitMQDsn) GetVirtualHost

func (rtm *RabbitMQDsn) GetVirtualHost() string

Get VirtualHost.

type RabbitMQPublisher

type RabbitMQPublisher struct {
	Name    string `json:"name"`
	Clients []IRabbitMQServiceClient
}

Target host information.

func (*RabbitMQPublisher) GetClients

func (r *RabbitMQPublisher) GetClients() []IRabbitMQServiceClient

Get Clients.

func (*RabbitMQPublisher) GetName

func (r *RabbitMQPublisher) GetName() string

Get ExchangeName.

type RabbitMQServer

type RabbitMQServer struct {
	Host        string
	Port        string
	Username    string
	Password    string
	VirtualHost string
	Consumers   []IRabbitMQConsumer
	Publishers  []IRabbitMQPublisher
	AutoAck     bool
}

Target host information.

func (*RabbitMQServer) GetAutoAck

func (r *RabbitMQServer) GetAutoAck() bool

Get AutoAck.

func (*RabbitMQServer) GetConsumers

func (r *RabbitMQServer) GetConsumers() []IRabbitMQConsumer

Get Consumers.

func (*RabbitMQServer) GetHost

func (r *RabbitMQServer) GetHost() string

Get Host.

func (*RabbitMQServer) GetPassword

func (r *RabbitMQServer) GetPassword() string

Get Password.

func (*RabbitMQServer) GetPort

func (r *RabbitMQServer) GetPort() string

Get Port.

func (*RabbitMQServer) GetPublishers

func (r *RabbitMQServer) GetPublishers() []IRabbitMQPublisher

Get Publisher.

func (*RabbitMQServer) GetUsername

func (r *RabbitMQServer) GetUsername() string

Get Username.

func (*RabbitMQServer) GetVHost

func (r *RabbitMQServer) GetVHost() string

Get Virtual Host.

type Redis

type Redis struct {
	Host         string
	Port         string
	Username     string
	Password     string
	Database     int
	Debug        bool
	Repositories []IRedisRepository
}

func (*Redis) DebugMode

func (r *Redis) DebugMode() bool

func (*Redis) GetDatabase

func (r *Redis) GetDatabase() int

func (*Redis) GetDsn

func (r *Redis) GetDsn() string

func (*Redis) GetHost

func (r *Redis) GetHost() string

func (*Redis) GetPassword

func (r *Redis) GetPassword() string

func (*Redis) GetPort

func (r *Redis) GetPort() string

func (*Redis) GetRepositories

func (r *Redis) GetRepositories() []IRedisRepository

func (*Redis) GetUsername

func (r *Redis) GetUsername() string

type Replica added in v1.4.7

type Replica struct {
	IPV4 []net.IP `desc:"Replica IPV4 Address"`
	IPV6 []net.IP `desc:"Replica IPV6 Address"`
}

type ReplyTo

type ReplyTo struct {
	Exchange   string `json:"exchange"`
	RoutingKey string `json:"routing_key"`
}

func (*ReplyTo) Get

func (r *ReplyTo) Get() string

func (*ReplyTo) GetJson

func (r *ReplyTo) GetJson() string

func (*ReplyTo) SetRoutingKey

func (r *ReplyTo) SetRoutingKey(routingKey string)

type Repository added in v1.5.0

type Repository struct {
	DB  *gorm.DB
	Mu  *sync.RWMutex
	Con *sql.DB

	// sync
	DbName string
	Table  string
}

func (*Repository) DatabaseName added in v1.5.0

func (tbl *Repository) DatabaseName() string

Get database name of this repository

func (*Repository) SetDriver added in v1.5.0

func (tbl *Repository) SetDriver(db *gorm.DB, mu *sync.RWMutex)

Implement types.IMySQLRepository.

func (*Repository) TableName added in v1.5.0

func (tbl *Repository) TableName() string

Get table name of this repository

type Response

type Response struct {
	Code    int    `json:"code"`
	Status  string `json:"status"`
	Message string `json:"message,omitempty"`
}

Extender internal response

type SqLite added in v1.5.0

type SqLite struct {
	Debug           bool
	DBPath          string
	Repositories    []IMySQLRepository
	EnableMigration bool

	QueryFields              bool
	DisableNestedTransaction bool
	// contains filtered or unexported fields
}

type TcpClient

type TcpClient struct {
	Name    string
	Host    string
	Port    string
	Mode    string
	Clients []ITcpServiceClient
}

Client information

func (*TcpClient) GetClients

func (tcp *TcpClient) GetClients() []ITcpServiceClient

Get Clients

func (*TcpClient) GetHost

func (tcp *TcpClient) GetHost() string

Get Host

func (*TcpClient) GetMode

func (tcp *TcpClient) GetMode() string

Get Mode

func (*TcpClient) GetName

func (tcp *TcpClient) GetName() string

Get Name

func (*TcpClient) GetPort

func (tcp *TcpClient) GetPort() string

Get Port

type TcpConfig

type TcpConfig struct {
	Servers []ITcpServer
	Clients []ITcpClient
}

GRPC configuration struct

func (*TcpConfig) GetClients

func (tcp *TcpConfig) GetClients() []ITcpClient

Get gRPC client configuration

func (*TcpConfig) GetServers

func (tcp *TcpConfig) GetServers() []ITcpServer

Get gRPC server configuration

type TcpServer

type TcpServer struct {
	Port    string
	Mode    string
	Handler ITcpServiceHandler
}

Serve information

func (*TcpServer) GetHandler

func (tcp *TcpServer) GetHandler() ITcpServiceHandler

Get Clients

func (*TcpServer) GetMode

func (ts *TcpServer) GetMode() string

Get Mode

func (*TcpServer) GetPort

func (ts *TcpServer) GetPort() string

Get Port

type WebSocketBody

type WebSocketBody struct {
	Action string      `json:"action"`
	Data   interface{} `json:"data"`
}

func (*WebSocketBody) GetAction

func (wsb *WebSocketBody) GetAction() string

func (*WebSocketBody) GetData

func (wsb *WebSocketBody) GetData() interface{}

func (*WebSocketBody) SetAction

func (wsb *WebSocketBody) SetAction(action string)

func (*WebSocketBody) SetData

func (wsb *WebSocketBody) SetData(data interface{})

func (*WebSocketBody) Setup

func (wsb *WebSocketBody) Setup()

type WebSocketEvent

type WebSocketEvent struct {
	Connection *websocket.Conn
	Name       string
	Data       interface{}
	Debug      bool
	Body       IWebSocketBody
}

func (*WebSocketEvent) GetBody

func (m *WebSocketEvent) GetBody() []byte

func (*WebSocketEvent) GetConnection

func (m *WebSocketEvent) GetConnection() *websocket.Conn

func (*WebSocketEvent) GetData

func (m *WebSocketEvent) GetData() interface{}

func (*WebSocketEvent) GetDebug

func (m *WebSocketEvent) GetDebug() bool

func (*WebSocketEvent) GetName

func (m *WebSocketEvent) GetName() string

func (*WebSocketEvent) NilBody

func (m *WebSocketEvent) NilBody() bool

type WebSocketEventHandler

type WebSocketEventHandler struct {
	Debug bool
	// contains filtered or unexported fields
}

Engine for controller

func (*WebSocketEventHandler) Call

func (me *WebSocketEventHandler) Call(name string, event IWebSocketEvent)

func (*WebSocketEventHandler) Event

func (me *WebSocketEventHandler) Event(name string, handler func(IWebSocketEvent))

type WebSocketRoute

type WebSocketRoute struct {
	Path          string
	Handlers      func(IWebSocketEventHandler) // Service to inject
	CustomPayload IWebSocketBody
	// contains filtered or unexported fields
}

func (*WebSocketRoute) Initialize

func (wsr *WebSocketRoute) Initialize(server *gin.Engine, debug bool)

func (*WebSocketRoute) SetupHandler

func (wsr *WebSocketRoute) SetupHandler()

type WebSocketServer

type WebSocketServer struct {
	Port   string
	Mode   string
	Routes []IWebSocketRoute
}

Serve information

func (*WebSocketServer) GetMode

func (wss *WebSocketServer) GetMode() string

Get Mode

func (*WebSocketServer) GetPort

func (wss *WebSocketServer) GetPort() string

Get Port

func (*WebSocketServer) GetRoutes

func (wss *WebSocketServer) GetRoutes() []IWebSocketRoute

Get Router

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳