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 OnboardUserRuleToProto(m *models.OnboardUserRule) *commonv1.OnboardUserRule
- func OnboardUserWebFlowToProto(m *models.OnboardUserWebFlow) *commonv1.OnboardUserWebFlow
- func OrgBlueprintToProto(m *models.OrgBlueprint) *provisionerv1.OrgBlueprint
- func ProtoToBlueprintSummary(pb *commonv1.BlueprintSummary) *models.BlueprintSummary
- func ProtoToBlueprintValidation(pb *provisionerv1.ValidateBlueprintResponse) (*models.BlueprintValidation, error)
- func ProtoToCompleteUserWebFlow(pb *commonv1.CompleteUserWebFlow) *models.CompleteUserWebFlow
- func ProtoToInjectNamespaces(pb *provisionerv1.ListInjectNamespacesResponse) *models.InjectNamespaces
- func ProtoToInjectWorkload(pb *provisionerv1.InjectWorkload) *models.InjectWorkload
- func ProtoToNodeSelectorOptions(pb *provisionerv1.GetNodeSelectorOptionsResponse) *models.NodeSelectorOptions
- func ProtoToOnboardUserDeviceFlow(pb *commonv1.OnboardUserDeviceFlow) *models.OnboardUserDeviceFlow
- func ProtoToOnboardUserRule(pb *commonv1.OnboardUserRule) *models.OnboardUserRule
- func ProtoToOnboardUserWebFlow(pb *commonv1.OnboardUserWebFlow) *models.OnboardUserWebFlow
- func ProtoToOrgBlueprint(pb *provisionerv1.OrgBlueprint) *models.OrgBlueprint
- func ProtoToQueryDescriptor(desc *queryv1.Descriptor) *models.QueryDescriptor
- func ProtoToRepo(pb *identityv1.Repo) *models.Repo
- func ProtoToRepoOwner(pb *identityv1.RepoOwner) *models.RepoOwner
- func ProtoToUser(pb *commonv1.User) *models.User
- func ProtoToUserCredential(pb *commonv1.UserCredential) *models.UserCredential
- func ProtoToUserOnboardCapability(pb *commonv1.UserOnboardCapability) *models.OnboardCapability
- func ProtoToUserResult(pb *commonv1.UserResult) *models.UserResult
- 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 UserResultToProto(m *models.UserResult) *commonv1.UserResult
- func UserToProto(u *models.User) *commonv1.User
- func WithMD(ctx context.Context, kv ...string) context.Context
- func WorkspaceDetailsToProto(m *models.WorkspaceDetails) *commonv1.WorkspaceDetails
- func WorkspaceScheduleFromProto(pb *commonv1.WorkspaceSchedule) *models.WorkspaceSchedule
- func WorkspaceScheduleToProto(s *models.WorkspaceSchedule) *commonv1.WorkspaceSchedule
- 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 OnboardUserRuleToProto ¶ added in v0.40.0
func OnboardUserRuleToProto(m *models.OnboardUserRule) *commonv1.OnboardUserRule
OnboardUserRuleToProto 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 OrgBlueprintToProto ¶ added in v0.48.0
func OrgBlueprintToProto(m *models.OrgBlueprint) *provisionerv1.OrgBlueprint
OrgBlueprintToProto converts a Go OrgBlueprint model to its protobuf message.
func ProtoToBlueprintSummary ¶
func ProtoToBlueprintSummary(pb *commonv1.BlueprintSummary) *models.BlueprintSummary
ProtoToBlueprintSummary converts a protobuf BlueprintSummary message to its Go model.
func ProtoToBlueprintValidation ¶ added in v0.48.0
func ProtoToBlueprintValidation(pb *provisionerv1.ValidateBlueprintResponse) (*models.BlueprintValidation, error)
ProtoToBlueprintValidation converts a protobuf ValidateBlueprintResponse message to its Go model, decoding ResolvedBlueprint generically into Blueprint (see BlueprintValidation). ResolvedBlueprint is only set by the server when Valid is true, so Blueprint is left nil for any invalid submission; returns an error only if a present ResolvedBlueprint fails to parse as YAML.
func ProtoToCompleteUserWebFlow ¶
func ProtoToCompleteUserWebFlow(pb *commonv1.CompleteUserWebFlow) *models.CompleteUserWebFlow
ProtoToCompleteUserWebFlow converts a protobuf message to a Go model.
func ProtoToInjectNamespaces ¶ added in v0.38.0
func ProtoToInjectNamespaces(pb *provisionerv1.ListInjectNamespacesResponse) *models.InjectNamespaces
ProtoToInjectNamespaces converts a protobuf ListInjectNamespacesResponse message to its Go model.
func ProtoToInjectWorkload ¶ added in v0.38.0
func ProtoToInjectWorkload(pb *provisionerv1.InjectWorkload) *models.InjectWorkload
ProtoToInjectWorkload converts a protobuf InjectWorkload message to its Go model.
func ProtoToNodeSelectorOptions ¶ added in v0.65.4
func ProtoToNodeSelectorOptions(pb *provisionerv1.GetNodeSelectorOptionsResponse) *models.NodeSelectorOptions
ProtoToNodeSelectorOptions converts a GetNodeSelectorOptionsResponse to its Go model. Keys and values are never nil, so they marshal as [] not null.
func ProtoToOnboardUserDeviceFlow ¶
func ProtoToOnboardUserDeviceFlow(pb *commonv1.OnboardUserDeviceFlow) *models.OnboardUserDeviceFlow
ProtoToOnboardUserDeviceFlow converts a protobuf message to a Go model.
func ProtoToOnboardUserRule ¶ added in v0.40.0
func ProtoToOnboardUserRule(pb *commonv1.OnboardUserRule) *models.OnboardUserRule
ProtoToOnboardUserRule 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 ProtoToOrgBlueprint ¶ added in v0.48.0
func ProtoToOrgBlueprint(pb *provisionerv1.OrgBlueprint) *models.OrgBlueprint
ProtoToOrgBlueprint converts a protobuf OrgBlueprint message to its 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 ProtoToRepo ¶ added in v0.38.0
func ProtoToRepo(pb *identityv1.Repo) *models.Repo
ProtoToRepo converts a protobuf Repo message to its Go model.
func ProtoToRepoOwner ¶ added in v0.38.0
func ProtoToRepoOwner(pb *identityv1.RepoOwner) *models.RepoOwner
ProtoToRepoOwner converts a protobuf RepoOwner message to its Go model.
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 ProtoToUserResult ¶ added in v0.40.0
func ProtoToUserResult(pb *commonv1.UserResult) *models.UserResult
ProtoToUserResult 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 UserResultToProto ¶ added in v0.40.0
func UserResultToProto(m *models.UserResult) *commonv1.UserResult
UserResultToProto 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 WorkspaceScheduleFromProto ¶ added in v0.65.6
func WorkspaceScheduleFromProto(pb *commonv1.WorkspaceSchedule) *models.WorkspaceSchedule
WorkspaceScheduleFromProto converts a protobuf workspace schedule to its model.
func WorkspaceScheduleToProto ¶ added in v0.65.6
func WorkspaceScheduleToProto(s *models.WorkspaceSchedule) *commonv1.WorkspaceSchedule
WorkspaceScheduleToProto converts a workspace schedule 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