server

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CronTask

type CronTask struct {
	Name string
	Cron string
	Fn   func(ctx context.Context) error
}

type Event

type Event struct {
	ServiceStart func() error
	ServiceStop  func() error
	WorkerStart  func() error
	WorkerStop   func() error
}

type GrpcHandler

type GrpcHandler func(*grpc.Server)

type HttpHandler

type HttpHandler func(context.Context, *runtime.ServeMux, *grpc.ClientConn) error

type Server

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

func NewServer

func NewServer(ctx context.Context, logger *slog.Logger, tracer trace.Tracer, meter metric.Meter) *Server

func (*Server) AddDiscovery

func (s *Server) AddDiscovery(discovery discovery.Discovery)

func (*Server) Cron

func (s *Server) Cron(tasks []CronTask)

func (*Server) Grpc

func (s *Server) Grpc(cfg *config.Grpc, handlers ...GrpcHandler)

func (*Server) Http

func (s *Server) Http(cfg *config.Http, cfgRpc *config.Grpc, handlers ...HttpHandler)

func (*Server) Run

func (s *Server) Run() error

Jump to

Keyboard shortcuts

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