grpc

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2025 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HandlerTraceLogLevel         = 4
	HandlerDetailedTraceLogLevel = 5

	HandlerDefaultMaxStreamDuration = time.Minute * 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	api.UnimplementedSnapshotMetadataServer
	// contains filtered or unexported fields
}

func NewServer

func NewServer(config ServerConfig) (*Server, error)

func (*Server) CSIDriverIsReady

func (s *Server) CSIDriverIsReady()

CSIDriverIsReady is used to notify the server that the CSI driver is available for use.

func (*Server) GetMetadataAllocated

func (s *Server) GetMetadataAllocated(req *api.GetMetadataAllocatedRequest, stream api.SnapshotMetadata_GetMetadataAllocatedServer) (err error)

func (*Server) GetMetadataDelta

func (s *Server) GetMetadataDelta(req *api.GetMetadataDeltaRequest, stream api.SnapshotMetadata_GetMetadataDeltaServer) (err error)

func (*Server) OperationID

func (s *Server) OperationID(op string) string

OperationID generates a unique identifier for an operation.

func (*Server) Start

func (s *Server) Start() error

Start start the gRPC server in its own goroutine. The method guarantees that on successful return the gRPC server goroutine is running. The invoker should use the Stop() method to terminate the server when desired.

func (*Server) Stop

func (s *Server) Stop()

Stop terminates the gRPC server gracefully.

type ServerConfig

type ServerConfig struct {
	Runtime *runtime.Runtime

	// The maximum duration of a streaming session.
	// The handler will abort if either the CSI driver or
	// the client do not complete in this time.
	// If not set then HandlerDefaultMaxStreamDuration is used.
	MaxStreamDur time.Duration
}

Jump to

Keyboard shortcuts

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