Documentation
¶
Index ¶
- Constants
- Variables
- type BlueprintKind
- type CanonicalUserStr
- func (c *CanonicalUserStr) Aliases() []string
- func (c *CanonicalUserStr) CanonicalId() string
- func (c *CanonicalUserStr) CanonicalKey() string
- func (c *CanonicalUserStr) CanonicalUserStr() string
- func (c *CanonicalUserStr) CanonicalUserStrObj() *UserStr
- func (c *CanonicalUserStr) Identity() WorkspaceIdentity
- func (c *CanonicalUserStr) WorkspaceName() string
- type UserStr
- func (u *UserStr) Blueprint() string
- func (u *UserStr) BlueprintKind() BlueprintKind
- func (u *UserStr) Canonicalize() (*CanonicalUserStr, error)
- func (u *UserStr) Form() UserStrForm
- func (u *UserStr) Namespace(defaultValue string) string
- func (u *UserStr) ParamsRaw() map[string]string
- func (u *UserStr) Pod() string
- func (u *UserStr) Raw() string
- func (u *UserStr) RepoName() string
- func (u *UserStr) RepoOwner() string
- func (u *UserStr) RepoRef() string
- func (u *UserStr) User() string
- func (u *UserStr) Username() string
- func (u *UserStr) WorkloadKind() string
- func (u *UserStr) WorkloadName() string
- type UserStrFields
- type UserStrForm
- type UserStrGrammar
- type UserStrParamSpec
- type WorkspaceIdentity
- func (w *WorkspaceIdentity) Blueprint() string
- func (w *WorkspaceIdentity) BlueprintKind() BlueprintKind
- func (w *WorkspaceIdentity) Namespace() string
- func (w *WorkspaceIdentity) RepoName() string
- func (w *WorkspaceIdentity) RepoOwner() string
- func (w *WorkspaceIdentity) RepoRef() string
- func (w *WorkspaceIdentity) Username() string
- func (w *WorkspaceIdentity) WorkloadKind() string
- func (w *WorkspaceIdentity) WorkloadName() string
Constants ¶
const MAX_TOTAL_LEN = 128 // maximum allowed length for the entire userstr
Variables ¶
Functions ¶
This section is empty.
Types ¶
type BlueprintKind ¶
type BlueprintKind int
BlueprintKind represents the kind of blueprint used for a workspace.
const ( BlueprintKindImplicit BlueprintKind = iota // no explicit blueprint BlueprintKindExplicit // user-defined blueprint in userstr BlueprintKindCustom // user-defined blueprint name from repo )
func (BlueprintKind) String ¶
func (k BlueprintKind) String() string
type CanonicalUserStr ¶
type CanonicalUserStr struct {
// contains filtered or unexported fields
}
func (*CanonicalUserStr) Aliases ¶
func (c *CanonicalUserStr) Aliases() []string
func (*CanonicalUserStr) CanonicalId ¶
func (c *CanonicalUserStr) CanonicalId() string
CanonicalId returns a unique identifier for the workspace based on the username and canonical key
func (*CanonicalUserStr) CanonicalKey ¶
func (c *CanonicalUserStr) CanonicalKey() string
func (*CanonicalUserStr) CanonicalUserStr ¶
func (c *CanonicalUserStr) CanonicalUserStr() string
func (*CanonicalUserStr) CanonicalUserStrObj ¶
func (c *CanonicalUserStr) CanonicalUserStrObj() *UserStr
func (*CanonicalUserStr) Identity ¶
func (c *CanonicalUserStr) Identity() WorkspaceIdentity
Getters for CanonicalUserStr
func (*CanonicalUserStr) WorkspaceName ¶
func (c *CanonicalUserStr) WorkspaceName() string
type UserStr ¶
type UserStr struct {
// contains filtered or unexported fields
}
UserStr is the parsed user string object.
func ParseUserStr ¶
func ParseUserStrWithGrammar ¶
func ParseUserStrWithGrammar(input string, grammar UserStrGrammar) (*UserStr, error)
func (*UserStr) BlueprintKind ¶
func (u *UserStr) BlueprintKind() BlueprintKind
func (*UserStr) Canonicalize ¶
func (u *UserStr) Canonicalize() (*CanonicalUserStr, error)
func (*UserStr) Form ¶
func (u *UserStr) Form() UserStrForm
func (*UserStr) WorkloadKind ¶
func (*UserStr) WorkloadName ¶
type UserStrFields ¶
type UserStrFields struct {
Username string `json:"username"`
Blueprint string `json:"blueprint,omitempty"`
WorkloadKind string `json:"workloadKind,omitempty"`
WorkloadName string `json:"workloadName,omitempty"`
Pod string `json:"pod,omitempty"`
Namespace string `json:"namespace,omitempty"`
RepoOwner string `json:"repoOwner,omitempty"`
RepoName string `json:"repoName,omitempty"`
RepoRef string `json:"repoRef,omitempty"`
}
UserStrFields is a JSON-friendly representation.
func UserStrFieldsFromUserStr ¶
func UserStrFieldsFromUserStr(u *UserStr) UserStrFields
UserStrFieldsFromUserStr creates a payload from a parsed *UserStr. Note: Blueprint will be populated from u.Blueprint() (even for repo-derived blueprints).
func (UserStrFields) ToRawUserStr ¶
func (f UserStrFields) ToRawUserStr() (string, error)
ToRawUserStr returns the serialized userstr that would be parsed.
func (UserStrFields) ToUserStr ¶
func (f UserStrFields) ToUserStr() (*UserStr, error)
ToUserStr builds a userstr from the fields and parses it (single source of validation truth).
type UserStrForm ¶
type UserStrForm int
UserStrForm describes the semantic shape of a parsed user string.
const ( UserStrFormImplicit UserStrForm = iota UserStrFormExplicitBlueprint UserStrFormNamedWorkspace UserStrFormRepoWorkspace )
type UserStrGrammar ¶
type UserStrGrammar struct {
MaxTotalLen int
Params map[string]UserStrParamSpec
}
func DefaultGrammar ¶
func DefaultGrammar() UserStrGrammar
type UserStrParamSpec ¶
type UserStrParamSpec struct {
AllowedIn map[UserStrForm]bool
}
type WorkspaceIdentity ¶
type WorkspaceIdentity struct {
// contains filtered or unexported fields
}
WorkspaceIdentity is the canonical identity model.
func (*WorkspaceIdentity) Blueprint ¶
func (w *WorkspaceIdentity) Blueprint() string
func (*WorkspaceIdentity) BlueprintKind ¶
func (w *WorkspaceIdentity) BlueprintKind() BlueprintKind
func (*WorkspaceIdentity) Namespace ¶
func (w *WorkspaceIdentity) Namespace() string
func (*WorkspaceIdentity) RepoName ¶
func (w *WorkspaceIdentity) RepoName() string
func (*WorkspaceIdentity) RepoOwner ¶
func (w *WorkspaceIdentity) RepoOwner() string
func (*WorkspaceIdentity) RepoRef ¶
func (w *WorkspaceIdentity) RepoRef() string
func (*WorkspaceIdentity) Username ¶
func (w *WorkspaceIdentity) Username() string
Getters for WorkspaceIdentity
func (*WorkspaceIdentity) WorkloadKind ¶
func (w *WorkspaceIdentity) WorkloadKind() string
func (*WorkspaceIdentity) WorkloadName ¶
func (w *WorkspaceIdentity) WorkloadName() string