cmd

package
v1.40.2 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: GPL-3.0 Imports: 91 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 {
	*grpc.Server
	// contains filtered or unexported fields
}

GRPCServer configures the dependencies associated with the Flipt GRPC Service. It provides an entrypoint to start serving the gRPC stack (Run()). Along with a teardown function (Shutdown(ctx)).

func NewGRPCServer

func NewGRPCServer(
	ctx context.Context,
	logger *zap.Logger,
	cfg *config.Config,
	info info.Flipt,
	forceMigrate bool,
) (*GRPCServer, error)

NewGRPCServer constructs the core Flipt gRPC service including its dependencies (e.g. tracing, metrics, storage, migrations, caching and cleanup). It returns an instance of *GRPCServer which callers can Run().

func (*GRPCServer) Run

func (s *GRPCServer) Run() error

Run begins serving gRPC requests. This methods blocks until Shutdown is called.

func (*GRPCServer) Shutdown

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

Shutdown tearsdown the entire gRPC stack including dependencies.

type HTTPServer

type HTTPServer struct {
	*http.Server
	// contains filtered or unexported fields
}

HTTPServer is a wrapper around the construction and registration of Flipt's HTTP server.

func NewHTTPServer

func NewHTTPServer(
	ctx context.Context,
	logger *zap.Logger,
	cfg *config.Config,
	conn *grpc.ClientConn,
	info info.Flipt,
) (*HTTPServer, error)

NewHTTPServer constructs and configures the HTTPServer instance. The HTTPServer depends upon a running gRPC server instance which is why it explicitly requires and established gRPC connection as an argument.

func (*HTTPServer) Run

func (h *HTTPServer) Run() error

Run starts listening and serving the Flipt HTTP API. It blocks until the server is shutdown.

func (*HTTPServer) Shutdown

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

Shutdown triggers the shutdown operation of the HTTP API.

Jump to

Keyboard shortcuts

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