portergrpc

package
v1.0.17 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPorterConnectionToContext

func AddPorterConnectionToContext(p *porter.Porter, ctx context.Context) context.Context

AddPorterConnectionToContext adds the porter connection to the given context use GetPorterConnectionFromContext to read it back out

func GetPorterConnectionFromContext

func GetPorterConnectionFromContext(ctx context.Context) (*porter.Porter, error)

GetPorterConnectionFromContext returns the porter connection from the give context. Use AddPorterConnectionToContext to add one.

Types

type PorterServer

type PorterServer struct {
	PorterConfig *config.Config
	pGRPC.UnimplementedPorterServer
}

PorterServer defines the struct for managing a porter GRPC server

func NewPorterServer

func NewPorterServer(cfg *config.Config) (*PorterServer, error)

NewPorterServer creates a new instance of the PorterServer for a config

func (*PorterServer) ListInstallationLatestOutputs

ListInstallationLatestOutputs takes a GRPC ListInstallationLatestOutputRequest and returns the most recent outputs for the porter installation as a GRPC ListInstallationLatestOutputResponse

func (*PorterServer) ListInstallations

ListInstallations takes a GRPC ListInstallationsRequest and returns a filtered list of porter installations as a GRPC ListInstallationsResponse

func (*PorterServer) NewConnectionInterceptor

func (s *PorterServer) NewConnectionInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

NewConnectionInterceptor creates a middleware interceptor for the GRPC server that manages creating a porter connection for each requested RPC stream. If the connection is unable to be created for the RPC then the RPC fails, otherwise the connection is added to the RPC context and the next handler in the chain is called

Jump to

Keyboard shortcuts

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