Documentation ¶
Index ¶
- Variables
- func GetMetadataFromContext(ctx context.Context, key string) []string
- func SetMetadataFromContext(ctx context.Context, kv ...string) error
- type HandlerPrivatePlugin
- type HandlerPrivateRPC
- func (h *HandlerPrivateRPC) CreateUserAdmin(ctx context.Context, req *mgmtPB.CreateUserAdminRequest) (resp *mgmtPB.CreateUserAdminResponse, err error)
- func (h *HandlerPrivateRPC) DeleteUserAdmin(ctx context.Context, req *mgmtPB.DeleteUserAdminRequest) (resp *mgmtPB.DeleteUserAdminResponse, err error)
- func (h *HandlerPrivateRPC) GetUserAdmin(ctx context.Context, req *mgmtPB.GetUserAdminRequest) (resp *mgmtPB.GetUserAdminResponse, err error)
- func (h *HandlerPrivateRPC) ListUsersAdmin(ctx context.Context, req *mgmtPB.ListUsersAdminRequest) (resp *mgmtPB.ListUsersAdminResponse, err error)
- func (h *HandlerPrivateRPC) LookUpUserAdmin(ctx context.Context, req *mgmtPB.LookUpUserAdminRequest) (resp *mgmtPB.LookUpUserAdminResponse, err error)
- func (h *HandlerPrivateRPC) UpdateUserAdmin(ctx context.Context, req *mgmtPB.UpdateUserAdminRequest) (resp *mgmtPB.UpdateUserAdminResponse, err error)
- type HandlerPrivateRPCServer
- func (h *HandlerPrivateRPCServer) CreateUserAdmin(reqW *RequestWrapper, respW *ResponseWrapper) error
- func (h *HandlerPrivateRPCServer) DeleteUserAdmin(reqW *RequestWrapper, respW *ResponseWrapper) error
- func (h *HandlerPrivateRPCServer) GetUserAdmin(reqW *RequestWrapper, respW *ResponseWrapper) error
- func (h *HandlerPrivateRPCServer) ListUsersAdmin(reqW *RequestWrapper, respW *ResponseWrapper) error
- func (h *HandlerPrivateRPCServer) LookUpUserAdmin(reqW *RequestWrapper, respW *ResponseWrapper) error
- func (h *HandlerPrivateRPCServer) UpdateUserAdmin(reqW *RequestWrapper, respW *ResponseWrapper) error
- type HandlerPublicPlugin
- type HandlerPublicRPC
- func (h *HandlerPublicRPC) ExistUsername(ctx context.Context, req *mgmtPB.ExistUsernameRequest) (resp *mgmtPB.ExistUsernameResponse, err error)
- func (h *HandlerPublicRPC) Liveness(ctx context.Context, req *mgmtPB.LivenessRequest) (resp *mgmtPB.LivenessResponse, err error)
- func (h *HandlerPublicRPC) PatchAuthenticatedUser(ctx context.Context, req *mgmtPB.PatchAuthenticatedUserRequest) (resp *mgmtPB.PatchAuthenticatedUserResponse, err error)
- func (h *HandlerPublicRPC) QueryAuthenticatedUser(ctx context.Context, req *mgmtPB.QueryAuthenticatedUserRequest) (resp *mgmtPB.QueryAuthenticatedUserResponse, err error)
- func (h *HandlerPublicRPC) Readiness(ctx context.Context, req *mgmtPB.ReadinessRequest) (resp *mgmtPB.ReadinessResponse, err error)
- type HandlerPublicRPCServer
- func (h *HandlerPublicRPCServer) ExistUsername(reqW *RequestWrapper, respW *ResponseWrapper) error
- func (h *HandlerPublicRPCServer) Liveness(reqW *RequestWrapper, respW *ResponseWrapper) error
- func (h *HandlerPublicRPCServer) PatchAuthenticatedUser(reqW *RequestWrapper, respW *ResponseWrapper) error
- func (h *HandlerPublicRPCServer) QueryAuthenticatedUser(reqW *RequestWrapper, respW *ResponseWrapper) error
- func (h *HandlerPublicRPCServer) Readiness(reqW *RequestWrapper, respW *ResponseWrapper) error
- type MetadataContext
- type RequestWrapper
- type ResponseWrapper
Constants ¶
This section is empty.
Variables ¶
var Handshake = plugin.HandshakeConfig{
ProtocolVersion: 1,
MagicCookieKey: "PLUGIN",
MagicCookieValue: "handler",
}
Handshake is a common handshake that is shared by plugin and host.
Functions ¶
func GetMetadataFromContext ¶
GetMetadataFromContext gets metadata from the asserted MetadataContext type from the generic context.Context interface
Types ¶
type HandlerPrivatePlugin ¶
type HandlerPrivatePlugin struct { // Impl Injection Impl mgmtPB.MgmtPrivateServiceServer }
HandlerPrivatePlugin is the implementation of plugin.Plugin so we can serve/consume this
func (HandlerPrivatePlugin) Client ¶
func (HandlerPrivatePlugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)
Client is to implement the plugin.Plugin interface method
func (*HandlerPrivatePlugin) Server ¶
func (h *HandlerPrivatePlugin) Server(*plugin.MuxBroker) (interface{}, error)
Server is to implement the plugin.Plugin interface method
type HandlerPrivateRPC ¶
type HandlerPrivateRPC struct {
// contains filtered or unexported fields
}
HandlerPrivateRPC is an implementation that talks over RPC
func (*HandlerPrivateRPC) CreateUserAdmin ¶
func (h *HandlerPrivateRPC) CreateUserAdmin(ctx context.Context, req *mgmtPB.CreateUserAdminRequest) (resp *mgmtPB.CreateUserAdminResponse, err error)
CreateUserAdmin is method interface for plugin client
func (*HandlerPrivateRPC) DeleteUserAdmin ¶
func (h *HandlerPrivateRPC) DeleteUserAdmin(ctx context.Context, req *mgmtPB.DeleteUserAdminRequest) (resp *mgmtPB.DeleteUserAdminResponse, err error)
DeleteUserAdmin is method interface for plugin client
func (*HandlerPrivateRPC) GetUserAdmin ¶
func (h *HandlerPrivateRPC) GetUserAdmin(ctx context.Context, req *mgmtPB.GetUserAdminRequest) (resp *mgmtPB.GetUserAdminResponse, err error)
GetUserAdmin is method interface for plugin client
func (*HandlerPrivateRPC) ListUsersAdmin ¶
func (h *HandlerPrivateRPC) ListUsersAdmin(ctx context.Context, req *mgmtPB.ListUsersAdminRequest) (resp *mgmtPB.ListUsersAdminResponse, err error)
ListUsersAdmin is method interface for plugin client
func (*HandlerPrivateRPC) LookUpUserAdmin ¶
func (h *HandlerPrivateRPC) LookUpUserAdmin(ctx context.Context, req *mgmtPB.LookUpUserAdminRequest) (resp *mgmtPB.LookUpUserAdminResponse, err error)
LookUpUserAdmin is method interface for plugin client
func (*HandlerPrivateRPC) UpdateUserAdmin ¶
func (h *HandlerPrivateRPC) UpdateUserAdmin(ctx context.Context, req *mgmtPB.UpdateUserAdminRequest) (resp *mgmtPB.UpdateUserAdminResponse, err error)
UpdateUserAdmin is method interface for plugin client
type HandlerPrivateRPCServer ¶
type HandlerPrivateRPCServer struct { // This is the real implementation Impl mgmtPB.MgmtPrivateServiceServer }
HandlerPrivateRPCServer is the RPC server that HandlerRPC talks to, conforming to the requirements of net/rpc
func (*HandlerPrivateRPCServer) CreateUserAdmin ¶
func (h *HandlerPrivateRPCServer) CreateUserAdmin(reqW *RequestWrapper, respW *ResponseWrapper) error
CreateUserAdmin is the implementation for plugin server
func (*HandlerPrivateRPCServer) DeleteUserAdmin ¶
func (h *HandlerPrivateRPCServer) DeleteUserAdmin(reqW *RequestWrapper, respW *ResponseWrapper) error
DeleteUserAdmin is the implementation for plugin server
func (*HandlerPrivateRPCServer) GetUserAdmin ¶
func (h *HandlerPrivateRPCServer) GetUserAdmin(reqW *RequestWrapper, respW *ResponseWrapper) error
GetUserAdmin is the implementation for plugin server
func (*HandlerPrivateRPCServer) ListUsersAdmin ¶
func (h *HandlerPrivateRPCServer) ListUsersAdmin(reqW *RequestWrapper, respW *ResponseWrapper) error
ListUsersAdmin is the implementation for plugin server
func (*HandlerPrivateRPCServer) LookUpUserAdmin ¶
func (h *HandlerPrivateRPCServer) LookUpUserAdmin(reqW *RequestWrapper, respW *ResponseWrapper) error
LookUpUserAdmin is the implementation for plugin server
func (*HandlerPrivateRPCServer) UpdateUserAdmin ¶
func (h *HandlerPrivateRPCServer) UpdateUserAdmin(reqW *RequestWrapper, respW *ResponseWrapper) error
UpdateUserAdmin is the implementation for plugin server
type HandlerPublicPlugin ¶
type HandlerPublicPlugin struct { // Impl Injection Impl mgmtPB.MgmtPublicServiceServer }
HandlerPublicPlugin is the implementation of plugin.Plugin so we can serve/consume this
func (HandlerPublicPlugin) Client ¶
func (HandlerPublicPlugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)
Client is to implement the plugin.Plugin interface method
func (*HandlerPublicPlugin) Server ¶
func (h *HandlerPublicPlugin) Server(*plugin.MuxBroker) (interface{}, error)
Server is to implement the plugin.Plugin interface method
type HandlerPublicRPC ¶
type HandlerPublicRPC struct {
// contains filtered or unexported fields
}
HandlerPublicRPC is an implementation that talks over RPC
func (*HandlerPublicRPC) ExistUsername ¶
func (h *HandlerPublicRPC) ExistUsername(ctx context.Context, req *mgmtPB.ExistUsernameRequest) (resp *mgmtPB.ExistUsernameResponse, err error)
ExistUsername is method interface for plugin client
func (*HandlerPublicRPC) Liveness ¶
func (h *HandlerPublicRPC) Liveness(ctx context.Context, req *mgmtPB.LivenessRequest) (resp *mgmtPB.LivenessResponse, err error)
Liveness is method interface for plugin client
func (*HandlerPublicRPC) PatchAuthenticatedUser ¶
func (h *HandlerPublicRPC) PatchAuthenticatedUser(ctx context.Context, req *mgmtPB.PatchAuthenticatedUserRequest) (resp *mgmtPB.PatchAuthenticatedUserResponse, err error)
PatchAuthenticatedUser is method interface for plugin client
func (*HandlerPublicRPC) QueryAuthenticatedUser ¶
func (h *HandlerPublicRPC) QueryAuthenticatedUser(ctx context.Context, req *mgmtPB.QueryAuthenticatedUserRequest) (resp *mgmtPB.QueryAuthenticatedUserResponse, err error)
QueryAuthenticatedUser is method interface for plugin client
func (*HandlerPublicRPC) Readiness ¶
func (h *HandlerPublicRPC) Readiness(ctx context.Context, req *mgmtPB.ReadinessRequest) (resp *mgmtPB.ReadinessResponse, err error)
Readiness is method interface for plugin client
type HandlerPublicRPCServer ¶
type HandlerPublicRPCServer struct { // This is the real implementation Impl mgmtPB.MgmtPublicServiceServer }
HandlerPublicRPCServer is the RPC server that HandlerRPC talks to, conforming to the requirements of net/rpc
func (*HandlerPublicRPCServer) ExistUsername ¶
func (h *HandlerPublicRPCServer) ExistUsername(reqW *RequestWrapper, respW *ResponseWrapper) error
ExistUsername is method interface for plugin server
func (*HandlerPublicRPCServer) Liveness ¶
func (h *HandlerPublicRPCServer) Liveness(reqW *RequestWrapper, respW *ResponseWrapper) error
Liveness is method interface for plugin server
func (*HandlerPublicRPCServer) PatchAuthenticatedUser ¶
func (h *HandlerPublicRPCServer) PatchAuthenticatedUser(reqW *RequestWrapper, respW *ResponseWrapper) error
PatchAuthenticatedUser is method interface for plugin server
func (*HandlerPublicRPCServer) QueryAuthenticatedUser ¶
func (h *HandlerPublicRPCServer) QueryAuthenticatedUser(reqW *RequestWrapper, respW *ResponseWrapper) error
QueryAuthenticatedUser is method interface for plugin server
func (*HandlerPublicRPCServer) Readiness ¶
func (h *HandlerPublicRPCServer) Readiness(reqW *RequestWrapper, respW *ResponseWrapper) error
Readiness is method interface for plugin server
type MetadataContext ¶
MetadataContext is to be shared with plugin handler to pass custom HTTP code using grpc/metadata in the server side. This is a workaround for that we can't directly pass context through gob.
type RequestWrapper ¶
type RequestWrapper struct { MetadataContext *MetadataContext RequestMessage interface{} }
RequestWrapper wrap a request protobuf message
type ResponseWrapper ¶
type ResponseWrapper struct { MetadataContext *MetadataContext ResponseMessage interface{} StatusCode codes.Code StatusMessage string StatusDetails []interface{} }
ResponseWrapper wrap a response protobuf message with its status returned by gRPC