server

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewJwt

func NewJwt(claim map[string]any) (string, error)

func Verify

func Verify(token string) (map[string]any, error)

Types

type Config

type Config interface {
	Get(string) string
}

type Server

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

func New

func New(cfg Config, services *Services) *Server

func (*Server) Close

func (s *Server) Close() error

func (*Server) Control

func (s *Server) Control(r *http.Request, w http.ResponseWriter) (map[string]any, bool)

func (*Server) Error

func (s *Server) Error(w http.ResponseWriter, status int, data any)

func (*Server) Listen

func (s *Server) Listen(ctx context.Context, cancelFunc context.CancelFunc)

func (*Server) Mux

func (s *Server) Mux() *http.ServeMux

func (*Server) Write

func (s *Server) Write(w http.ResponseWriter, data any)

type Services

type Services struct {
	TokenService  ports.TokenService
	BucketService ports.BucketService
	DataService   ports.DataService
	PointService  ports.PointService
}

Directories

Path Synopsis
dto
map

Jump to

Keyboard shortcuts

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