server

package
v0.0.0-...-53c86a8 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2021 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// Endpoint is the server endpoint.
	Endpoint string
	// IDS is the IdentityServer.
	IDS csi.IdentityServer
	// CS is the ControllerServer.
	CS csi.ControllerServer
	// NS is the NodeServer.
	NS csi.NodeServer
	// RequireLeaderElection can be set to start the server after a leader
	// election.
	RequireLeaderElection bool
	// UnaryInterceptors are the interceptors to be added in the grpc server.
	// The order of the interceptors form a chain of unary interceptors.
	// By default a LogGRPC interceptor is used if no interceptor is provided.
	// To use LogGRPC interceptor with other interceptors, it should be
	// explicitly included when setting the value.
	UnaryInterceptors []grpc.UnaryServerInterceptor
}

Options for the server.

type Server

type Server struct {
	Options

	// Graceful runnable helps implement Runnable interface for starting the
	// server with graceful shutdown.
	// NOTE: Runnables are components that controller manager can manage.
	*runnable.Graceful
	// contains filtered or unexported fields
}

Server is a CSI server.

func NewServer

func NewServer(ops Options, wg *sync.WaitGroup) *Server

NewServer creates a new server with graceful shutdown support.

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

Run starts the GRPC server. It is a blocking function.

func (*Server) Stop

func (s *Server) Stop() error

Stop stops the GRPC server gracefully.

Jump to

Keyboard shortcuts

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