Documentation ¶
Index ¶
- func AddPorterConnectionToContext(p *porter.Porter, ctx context.Context) context.Context
- func GetPorterConnectionFromContext(ctx context.Context) (*porter.Porter, error)
- type PorterServer
- func (s *PorterServer) ListInstallationLatestOutputs(ctx context.Context, req *iGRPCv1alpha1.ListInstallationLatestOutputRequest) (*iGRPCv1alpha1.ListInstallationLatestOutputResponse, error)
- func (s *PorterServer) ListInstallations(ctx context.Context, req *iGRPCv1alpha1.ListInstallationsRequest) (*iGRPCv1alpha1.ListInstallationsResponse, error)
- func (s *PorterServer) NewConnectionInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddPorterConnectionToContext ¶
AddPorterConnectionToContext adds the porter connection to the given context use GetPorterConnectionFromContext to read it back out
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 ¶
func (s *PorterServer) ListInstallationLatestOutputs(ctx context.Context, req *iGRPCv1alpha1.ListInstallationLatestOutputRequest) (*iGRPCv1alpha1.ListInstallationLatestOutputResponse, error)
ListInstallationLatestOutputs takes a GRPC ListInstallationLatestOutputRequest and returns the most recent outputs for the porter installation as a GRPC ListInstallationLatestOutputResponse
func (*PorterServer) ListInstallations ¶
func (s *PorterServer) ListInstallations(ctx context.Context, req *iGRPCv1alpha1.ListInstallationsRequest) (*iGRPCv1alpha1.ListInstallationsResponse, error)
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