api

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: GPL-3.0 Imports: 50 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorInterceptor

func ErrorInterceptor() grpc.UnaryServerInterceptor

func ErrorStreamInterceptor

func ErrorStreamInterceptor() grpc.StreamServerInterceptor

func GRPCGateway

func GRPCGateway(ctx context.Context, conf Config, metricsHandler http.HandlerFunc, oauthHandlers map[string]http.HandlerFunc) (http.Handler, error)

func NewAuthAPI

func NewAuthAPI(svc *auth.Server) pb.AuthServer

func NewClusterAPI

func NewClusterAPI(radosSvc *rados.Svc) pb.ClusterServer

func NewCrushRuleAPI

func NewCrushRuleAPI(radosSvc *rados.Svc) pb.CrushRuleServer

func NewGrpcServer

func NewGrpcServer(conf Config,
	clusterAPI pb.ClusterServer,
	usersAPI pb.UsersServer,
	authAPI pb.AuthServer,
	crushRuleAPI pb.CrushRuleServer,
	statusAPI pb.StatusServer,
	authN grpc_auth.AuthFunc,
	tracer otel_trace.TracerProvider,
	logConf log.Config) *grpc.Server

func NewStatusAPI

func NewStatusAPI(radosSvc *rados.Svc) pb.StatusServer

func NewUsersAPI

func NewUsersAPI(svc *user.Service) pb.UsersServer

func Serve

func Serve(ctx context.Context, conf Config, grpcServer *grpc.Server, httpServer http.Handler) (start func(context.Context) error, stop func(context.Context) error, err error)

Types

type Config

type Config struct {
	HttpPort       int  `yaml:"httpPort"`
	GrpcPort       int  `yaml:"grpcPort"`
	GrpcReflection bool `yaml:"grpcReflection"`
	Secure         bool `yaml:"secure"`
	ServeDebug     bool `yaml:"serveDebug"`
	AccessLog      bool `yaml:"accessLog"`
}

Jump to

Keyboard shortcuts

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