Documentation
¶
Index ¶
- Variables
- func BlueprintSummaryToProto(m *models.BlueprintSummary) *commonv1.BlueprintSummary
- func CompleteUserWebFlowToProto(m *models.CompleteUserWebFlow) *commonv1.CompleteUserWebFlow
- func OnboardUserDeviceFlowToProto(m *models.OnboardUserDeviceFlow) *commonv1.OnboardUserDeviceFlow
- func OnboardUserWebFlowToProto(m *models.OnboardUserWebFlow) *commonv1.OnboardUserWebFlow
- func ProtoToBlueprintSummary(pb *commonv1.BlueprintSummary) *models.BlueprintSummary
- func ProtoToCompleteUserWebFlow(pb *commonv1.CompleteUserWebFlow) *models.CompleteUserWebFlow
- func ProtoToOnboardUserDeviceFlow(pb *commonv1.OnboardUserDeviceFlow) *models.OnboardUserDeviceFlow
- func ProtoToOnboardUserWebFlow(pb *commonv1.OnboardUserWebFlow) *models.OnboardUserWebFlow
- func ProtoToQueryDescriptor(desc *queryv1.Descriptor) *models.QueryDescriptor
- func ProtoToUser(pb *commonv1.User) *models.User
- func ProtoToUserCredential(pb *commonv1.UserCredential) *models.UserCredential
- func ProtoToUserOnboardCapability(pb *commonv1.UserOnboardCapability) *models.OnboardCapability
- func ProtoToWorkspaceDetails(pb *commonv1.WorkspaceDetails) *models.WorkspaceDetails
- func ProtoToWorkspaceStatus(pb *commonv1.WorkspaceStatus) *models.WorkspaceStatus
- func QueryPayloadToProto(p *models.QueryPayload) (*queryv1.Payload, error)
- func UserCredentialToProto(c *models.UserCredential) *commonv1.UserCredential
- func UserOnboardCapabilityToProto(m *models.OnboardCapability) *commonv1.UserOnboardCapability
- func UserToProto(u *models.User) *commonv1.User
- func WithMD(ctx context.Context, kv ...string) context.Context
- func WorkspaceDetailsToProto(m *models.WorkspaceDetails) *commonv1.WorkspaceDetails
- func WorkspaceStatusToProto(m *models.WorkspaceStatus) *commonv1.WorkspaceStatus
- type AllowedCaller
- type Caller
- type Client
- type ClientConfig
- type Server
- type ServerConfig
- type ServiceRegistrationFunc
Constants ¶
This section is empty.
Variables ¶
var ErrNotEnabled = errors.New("grpc api client is not enabled")
ErrNotEnabled is returned by NewClient when the client is explicitly disabled.
Functions ¶
func BlueprintSummaryToProto ¶
func BlueprintSummaryToProto(m *models.BlueprintSummary) *commonv1.BlueprintSummary
BlueprintSummaryToProto converts a Go BlueprintSummary model to its protobuf message.
func CompleteUserWebFlowToProto ¶
func CompleteUserWebFlowToProto(m *models.CompleteUserWebFlow) *commonv1.CompleteUserWebFlow
CompleteUserWebFlowToProto converts a Go model to a protobuf message.
func OnboardUserDeviceFlowToProto ¶
func OnboardUserDeviceFlowToProto(m *models.OnboardUserDeviceFlow) *commonv1.OnboardUserDeviceFlow
OnboardUserDeviceFlowToProto converts a Go model to a protobuf message.
func OnboardUserWebFlowToProto ¶
func OnboardUserWebFlowToProto(m *models.OnboardUserWebFlow) *commonv1.OnboardUserWebFlow
OnboardUserWebFlowToProto converts a Go model to a protobuf message.
func ProtoToBlueprintSummary ¶
func ProtoToBlueprintSummary(pb *commonv1.BlueprintSummary) *models.BlueprintSummary
ProtoToBlueprintSummary converts a protobuf BlueprintSummary message to its Go model.
func ProtoToCompleteUserWebFlow ¶
func ProtoToCompleteUserWebFlow(pb *commonv1.CompleteUserWebFlow) *models.CompleteUserWebFlow
ProtoToCompleteUserWebFlow converts a protobuf message to a Go model.
func ProtoToOnboardUserDeviceFlow ¶
func ProtoToOnboardUserDeviceFlow(pb *commonv1.OnboardUserDeviceFlow) *models.OnboardUserDeviceFlow
ProtoToOnboardUserDeviceFlow converts a protobuf message to a Go model.
func ProtoToOnboardUserWebFlow ¶
func ProtoToOnboardUserWebFlow(pb *commonv1.OnboardUserWebFlow) *models.OnboardUserWebFlow
ProtoToOnboardUserWebFlow converts a protobuf message to a Go model.
func ProtoToQueryDescriptor ¶ added in v0.35.0
func ProtoToQueryDescriptor(desc *queryv1.Descriptor) *models.QueryDescriptor
ProtoToQueryDescriptor converts a query.v1.Descriptor proto into the JSON shape served by a resource's _schema HTTP endpoint.
func ProtoToUserCredential ¶
func ProtoToUserCredential(pb *commonv1.UserCredential) *models.UserCredential
ProtoToUserCredential converts a protobuf message to a Go model.
func ProtoToUserOnboardCapability ¶
func ProtoToUserOnboardCapability(pb *commonv1.UserOnboardCapability) *models.OnboardCapability
ProtoToUserOnboardCapability converts a protobuf message to a Go model.
func ProtoToWorkspaceDetails ¶
func ProtoToWorkspaceDetails(pb *commonv1.WorkspaceDetails) *models.WorkspaceDetails
ProtoToWorkspaceDetails converts a protobuf WorkspaceDetails message to its Go model.
func ProtoToWorkspaceStatus ¶
func ProtoToWorkspaceStatus(pb *commonv1.WorkspaceStatus) *models.WorkspaceStatus
ProtoToWorkspaceStatus converts a protobuf WorkspaceStatus message to its Go model.
func QueryPayloadToProto ¶ added in v0.35.0
func QueryPayloadToProto(p *models.QueryPayload) (*queryv1.Payload, error)
QueryPayloadToProto converts a client-issued JSON query payload into a query.v1.Payload proto, rejecting any op/dir/filter-op values outside the known enum strings. It does not validate field names, per-field operator permissions, or value types against a resource's schema — that's query.Validate's job (pkg/query) once the caller has a Descriptor to validate against.
func UserCredentialToProto ¶
func UserCredentialToProto(c *models.UserCredential) *commonv1.UserCredential
UserCredentialToProto converts a Go model to a protobuf message.
func UserOnboardCapabilityToProto ¶
func UserOnboardCapabilityToProto(m *models.OnboardCapability) *commonv1.UserOnboardCapability
UserOnboardCapabilityToProto converts a Go model to a protobuf message.
func WithMD ¶
WithMD returns a new context with the provided key-value pairs added to outgoing gRPC metadata.
func WorkspaceDetailsToProto ¶
func WorkspaceDetailsToProto(m *models.WorkspaceDetails) *commonv1.WorkspaceDetails
WorkspaceDetailsToProto converts a Go WorkspaceDetails model to its protobuf message.
func WorkspaceStatusToProto ¶
func WorkspaceStatusToProto(m *models.WorkspaceStatus) *commonv1.WorkspaceStatus
WorkspaceStatusToProto converts a Go WorkspaceStatus model to its protobuf message.
Types ¶
type AllowedCaller ¶
type Client ¶
type Client struct {
Conn *grpc.ClientConn
// contains filtered or unexported fields
}
Client gRPC client
func NewClient ¶
func NewClient(cfg ClientConfig) (*Client, error)
NewClient creates and returns a new gRPC client connection.
type ClientConfig ¶
type ClientConfig struct {
// Address of the gRPC server, e.g. "localhost:50051".
// Use the dns:/// scheme to enable client-side round-robin load balancing
// across multiple endpoints (e.g. a headless Service in Kubernetes):
// "dns:///grpc-server-headless.default.svc.cluster.local:50051"
Address string `yaml:"address"`
// ServerName is optional TLS ServerName for hostname verification.
// Required if CACertPath is set and cert SAN doesn't match address host.
ServerName string `yaml:"serverName"`
// TokenFilePath is path to file containing token for authentication.
// The file is read on each request to support token rotation.
TokenFilePath string `yaml:"tokenFilePath"`
// CACertPath is optional path to CA cert for TLS.
// If empty, TLS is disabled and credentials are insecure.
CACertPath string `yaml:"caCertPath"`
}
ClientConfig holds configuration for gRPC client
func (*ClientConfig) IsEnabled ¶
func (c *ClientConfig) IsEnabled() bool
type Server ¶
func (*Server) AddInterceptor ¶
func (s *Server) AddInterceptor(interceptor grpc.UnaryServerInterceptor)
func (*Server) RegisterService ¶
func (s *Server) RegisterService(regFunc ServiceRegistrationFunc) error
RegisterService adds a service registration callback
type ServerConfig ¶
type ServerConfig struct {
Port int `yaml:"port"`
EnableTLS bool `yaml:"enableTLS"`
CertFile string `yaml:"certFile"`
KeyFile string `yaml:"keyFile"`
CertReloadDelay time.Duration `yaml:"certReloadDelay"`
AuthEnabled bool `yaml:"authEnabled"`
IssuerURL string `yaml:"issuerURL"`
Audience string `yaml:"audience"`
Allowed []AllowedCaller `yaml:"allowed"`
}
type ServiceRegistrationFunc ¶
ServiceRegistrationFunc is a callback function to register services on the gRPC server