server

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GRPCServer

type GRPCServer struct {
	pb.UnimplementedUsageServiceServer
	// contains filtered or unexported fields
}

GRPCServer wraps the gRPC server implementation

func NewGRPCServer

func NewGRPCServer(repo *repository.Repository, addr string) *GRPCServer

NewGRPCServer creates a new gRPC server with a repository.

func NewGRPCServerWithService

func NewGRPCServerWithService(usageService *service.UsageService, addr string, verifier *auth.Verifier) *GRPCServer

NewGRPCServerWithService creates a new gRPC server with an existing usage service. A nil or empty verifier serves without authentication.

func (*GRPCServer) GetUsageByMeta

GetUsageByMeta returns usage aggregated over events carrying a meta key/value (e.g. one batch job), split by an optional second meta key plus vendor and model.

func (*GRPCServer) GetUsageSummary

GetUsageSummary returns aggregated usage statistics

func (*GRPCServer) RecordUsageEvent

RecordUsageEvent records a single usage event

func (*GRPCServer) RecordUsageEvents

RecordUsageEvents records multiple usage events in a batch

func (*GRPCServer) Start

func (s *GRPCServer) Start() error

Start starts the gRPC server

func (*GRPCServer) Stop

func (s *GRPCServer) Stop()

Stop gracefully stops the gRPC server

type HTTPServer

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

HTTPServer wraps the HTTP server implementation

func NewHTTPServer

func NewHTTPServer(repo *repository.Repository, addr string) *HTTPServer

NewHTTPServer creates a new HTTP server

func NewHTTPServerWithService

func NewHTTPServerWithService(usageService *service.UsageService, repo *repository.Repository, addr string, verifier *auth.Verifier) *HTTPServer

NewHTTPServerWithService creates a new HTTP server with an existing usage service. A nil or empty verifier serves without authentication.

func (*HTTPServer) Shutdown

func (s *HTTPServer) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the HTTP server

func (*HTTPServer) Start

func (s *HTTPServer) Start() error

Start starts the HTTP server

Jump to

Keyboard shortcuts

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