server

package
v0.0.29 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2024 License: MIT Imports: 49 Imported by: 0

README

server 包

  • ✅http服务
  • ✅GRPC服务
  • ☑️websocket服务
  • ☑️mq服务
  • ☑️定时任务(有状态服务)
  • ☑️crontab任务(无状态服务)

Documentation

Index

Constants

This section is empty.

Variables

ProviderSetServer is server providers.

Functions

func NewGRPCServer

func NewGRPCServer(
	c *conf.Server,
	d *data.Data,
	apiWhite *conf.ApiWhite,
	logger log.Logger,
) *grpc.Server

NewGRPCServer new a gRPC server.

func NewHTTPServer

func NewHTTPServer(
	c *conf.Server,
	jwtConf *conf.JWT,
	d *data.Data,
	apiWhite *conf.ApiWhite,
	logger log.Logger,
) *http.Server

NewHTTPServer new an HTTP server.

Types

type AgentInfo

type AgentInfo struct {
	Topic string `json:"topic"`
	Url   string `json:"key"`
}

func (*AgentInfo) String

func (a *AgentInfo) String() string

String AgentInfo to string

type AlarmEvent

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

func NewAlarmEvent

func NewAlarmEvent(
	d *data.Data,
	c *conf.Interflow,
	changeGroupChannel <-chan uint32,
	removeGroupChannel <-chan bo.RemoveStrategyGroupBO,
	hookService *alarmservice.HookService,
	groupService *promservice.GroupService,
	logger log.Logger,
) (*AlarmEvent, error)

func (*AlarmEvent) Start

func (l *AlarmEvent) Start(_ context.Context) error

func (*AlarmEvent) Stop

func (l *AlarmEvent) Stop(_ context.Context) error

type GrpcServer

type GrpcServer struct {
	*grpc.Server
}

func RegisterGrpcServer

func RegisterGrpcServer(
	srv *grpc.Server,
	pingService *service.PingService,
	dictService *systemservice.Service,
	strategyService *promservice.StrategyService,
	strategyGroupService *promservice.GroupService,
	hookService *alarmservice.HookService,
	historyService *alarmservice.HistoryService,
	userService *systemservice.UserService,
	roleService *systemservice.RoleService,
	endpointService *promservice.EndpointService,
	apiService *systemservice.ApiService,
	chatGroupService *promservice.ChatGroupService,
	notifyService *promservice.NotifyService,
	realtimeService *alarmservice.RealtimeService,
	chartService *dashboardservice.ChartService,
	dashboardService *dashboardservice.DashboardService,
	syslogService *systemservice.SyslogService,
) *GrpcServer

RegisterGrpcServer register a gRPC server.

type HttpServer

type HttpServer struct {
	*http.Server
}

func RegisterHttpServer

func RegisterHttpServer(
	srv *http.Server,
	pingService *service.PingService,
	dictService *systemservice.Service,
	strategyService *promservice.StrategyService,
	strategyGroupService *promservice.GroupService,
	hookService *alarmservice.HookService,
	historyService *alarmservice.HistoryService,
	authService *authservice.AuthService,
	userService *systemservice.UserService,
	roleService *systemservice.RoleService,
	endpointService *promservice.EndpointService,
	apiService *systemservice.ApiService,
	chatGroupService *promservice.ChatGroupService,
	notifyService *promservice.NotifyService,
	realtimeService *alarmservice.RealtimeService,
	interflowService *interflowservice.HookInterflowService,
	chartService *dashboardservice.ChartService,
	dashboardService *dashboardservice.DashboardService,
	syslogService *systemservice.SyslogService,
	templateService *promservice.TemplateService,
) *HttpServer

RegisterHttpServer new a HTTP server register.

type Server

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

func NewServer

func NewServer(hSrv *HttpServer, gSrv *GrpcServer, alarmEvent *AlarmEvent, ws *WebsocketServer) *Server

func (*Server) List

func (l *Server) List() []transport.Server

type WebsocketServer

type WebsocketServer struct {
	*servers.WebsocketServer
	// contains filtered or unexported fields
}

func NewWebsocketServer

func NewWebsocketServer(c *conf.Server, l log.Logger) *WebsocketServer

Jump to

Keyboard shortcuts

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