Documentation ¶
Index ¶
- Constants
- Variables
- func AddNamespaceHeaders(ctx context.Context, headers *http.Header)
- func AnonymousCall(ctx context.Context, endpoint string, method string, req interface{}, ...) error
- func AuthenticatedCall(ctx context.Context, endpoint string, method string, req interface{}, ...) error
- func BearerToken(t Token) string
- func CompleteLogin(ctx context.Context, id, ephemeralCliId string) (*auth.UserAuth, error)
- func DecodeJSONResponse(resp any) func(io.Reader) error
- func Map(ctx context.Context, fqdn, target string) error
- func ResolveSpec() (string, error)
- func SetupFlags(flags *pflag.FlagSet)
- func WithTelemetry(ctx context.Context) context.Context
- type AllocateOpts
- type Artifact
- type Call
- type CompleteClerkLoginResponse
- type CompleteLoginRequest
- type CompleteTenantLoginResponse
- type ExchangeGithubTokenRequest
- type ExchangeGithubTokenResponse
- type ExchangeTenantTokenRequest
- type ExchangeTenantTokenResponse
- type ExchangeUserTokenRequest
- type ExchangeUserTokenResponse
- type GetLatestDeployPlansRequest
- type GetLatestDeployPlansResponse
- type GetLatestDeployPlansResponse_Plan
- type GetLatestPrebuiltsRequest
- type GetLatestPrebuiltsResponse
- type GetLatestPrebuiltsResponse_Prebuilt
- type GetLatestResponse
- type IssueRequest
- type IssueResponse
- type MapRequest
- type MapResponse
- type NSRequirements
- type NameCertificate
- type NameRequest
- type NameResource
- type ResourceID
- type StartLoginRequest
- type StartLoginResponse
- type Telemetry
- func (tel *Telemetry) Enable()
- func (tel *Telemetry) GetClientID() string
- func (tel *Telemetry) IsFirstRun() bool
- func (tel *Telemetry) IsTelemetryEnabled() bool
- func (tel *Telemetry) RecordError(ctx context.Context, err error)
- func (tel *Telemetry) RecordInvocation(ctx context.Context, cmd *cobra.Command, args []string) string
- type Tenant
- type Token
Constants ¶
View Source
const AdminScope = "admin"
Variables ¶
View Source
var ( EndpointAddress = "https://api.namespacelabs.net" AdminMode = false ExchangeGithubToTenantToken = false )
View Source
var NamingForceStored = false
Functions ¶
func AddNamespaceHeaders ¶ added in v0.0.82
func AnonymousCall ¶
func AnonymousCall(ctx context.Context, endpoint string, method string, req interface{}, handle func(io.Reader) error) error
A nil handle indicates that the caller wants to discard the response.
func AuthenticatedCall ¶ added in v0.0.110
func BearerToken ¶ added in v0.0.176
func CompleteLogin ¶
func ResolveSpec ¶ added in v0.0.216
func SetupFlags ¶
Types ¶
type AllocateOpts ¶
type AllocateOpts struct { Scope schema.PackageName `json:"-"` FQDN string `json:"fqdn,omitempty"` Subdomain string `json:"subdomain,omitempty"` NoTLS bool `json:"-"` Org string `json:"org,omitempty"` Stored *NameResource `json:"-"` }
JSON annotations below are used for the Arg() serialization below.
type Call ¶
type CompleteClerkLoginResponse ¶ added in v0.0.96
type CompleteClerkLoginResponse struct {
Ticket string `json:"ticket,omitempty"`
}
func CompleteClerkLogin ¶ added in v0.0.180
func CompleteClerkLogin(ctx context.Context, id, ephemeralCliId string) (*CompleteClerkLoginResponse, error)
type CompleteLoginRequest ¶
type CompleteTenantLoginResponse ¶ added in v0.0.180
type CompleteTenantLoginResponse struct { TenantToken string `json:"tenant_token,omitempty"` TenantName string `json:"tenant_name,omitempty"` }
func CompleteTenantLogin ¶ added in v0.0.180
func CompleteTenantLogin(ctx context.Context, id, ephemeralCliId string) (*CompleteTenantLoginResponse, error)
type ExchangeGithubTokenRequest ¶ added in v0.0.142
type ExchangeGithubTokenRequest struct {
GithubToken string `json:"github_token,omitempty"`
}
type ExchangeGithubTokenResponse ¶ added in v0.0.142
type ExchangeGithubTokenResponse struct { TenantToken string `json:"tenant_token,omitempty"` Tenant *Tenant `json:"tenant,omitempty"` }
func ExchangeGithubToken ¶ added in v0.0.142
func ExchangeGithubToken(ctx context.Context, jwt string) (ExchangeGithubTokenResponse, error)
type ExchangeTenantTokenRequest ¶ added in v0.0.161
type ExchangeTenantTokenResponse ¶ added in v0.0.161
type ExchangeTenantTokenResponse struct {
TenantToken string `json:"tenant_token,omitempty"`
}
func ExchangeTenantToken ¶ added in v0.0.161
func ExchangeTenantToken(ctx context.Context, scopes []string) (ExchangeTenantTokenResponse, error)
type ExchangeUserTokenRequest ¶ added in v0.0.161
type ExchangeUserTokenRequest struct {
Scopes []string `json:"scopes,omitempty"`
}
type ExchangeUserTokenResponse ¶ added in v0.0.161
type ExchangeUserTokenResponse struct {
TenantToken string `json:"tenant_token,omitempty"`
}
func ExchangeUserToken ¶ added in v0.0.161
type GetLatestDeployPlansRequest ¶ added in v0.0.109
type GetLatestDeployPlansRequest struct {
PackageName []string `json:"package_name,omitempty"`
}
type GetLatestDeployPlansResponse ¶ added in v0.0.109
type GetLatestDeployPlansResponse struct {
Plan []*GetLatestDeployPlansResponse_Plan `json:"plan,omitempty"`
}
func GetLatestDeployPlans ¶ added in v0.0.109
func GetLatestDeployPlans(ctx context.Context, pkgs ...schema.PackageName) (*GetLatestDeployPlansResponse, error)
type GetLatestDeployPlansResponse_Plan ¶ added in v0.0.109
type GetLatestPrebuiltsRequest ¶
type GetLatestPrebuiltsRequest struct {
PackageName []string `json:"package_name,omitempty"`
}
type GetLatestPrebuiltsResponse ¶
type GetLatestPrebuiltsResponse struct {
Prebuilt []*GetLatestPrebuiltsResponse_Prebuilt `json:"prebuilt,omitempty"`
}
func GetLatestPrebuilts ¶
func GetLatestPrebuilts(ctx context.Context, pkgs ...schema.PackageName) (*GetLatestPrebuiltsResponse, error)
type GetLatestResponse ¶
type GetLatestResponse struct { Version string `json:"version"` BuildTime time.Time `json:"build_time"` Tarballs []*Artifact `json:"tarballs"` }
func GetLatestVersion ¶
type IssueRequest ¶
type IssueRequest struct { NameRequest NameRequest `json:"name_request"` Resource NameResource `json:"previous"` }
type IssueResponse ¶
type IssueResponse struct {
Resource NameResource `json:"resource"`
}
type MapRequest ¶
type MapResponse ¶
type MapResponse struct {
FQDN string `json:"fqdn"`
}
type NSRequirements ¶
type NSRequirements struct {
MinimumApi int32 `json:"minimum_api"`
}
type NameCertificate ¶
type NameRequest ¶
type NameResource ¶
type NameResource struct { ID ResourceID `json:"id"` Certificate NameCertificate `json:"certificate"` }
func AllocateName ¶
func AllocateName(ctx context.Context, opts AllocateOpts) (*NameResource, error)
type ResourceID ¶
type ResourceID struct {
Opaque []byte `json:"opaque"`
}
type StartLoginRequest ¶
type StartLoginResponse ¶
type StartLoginResponse struct { LoginId string `json:"login_id"` LoginUrl string `json:"login_url"` Kind string `json:"kind"` }
func StartLogin ¶
func StartLogin(ctx context.Context, kind, tenantId string) (*StartLoginResponse, error)
Returns the URL which the user should open.
type Telemetry ¶
type Telemetry struct {
// contains filtered or unexported fields
}
func InternalNewTelemetry ¶ added in v0.0.76
func NewTelemetry ¶
func TelemetryOn ¶
func (*Telemetry) Enable ¶
func (tel *Telemetry) Enable()
Telemetry needs to be excplicitly enabled by calling this function. IsTelemetryEnabled() may still be false if telemetry is disabled through DO_NOT_TRACK, etc.
func (*Telemetry) GetClientID ¶ added in v0.0.76
func (*Telemetry) IsFirstRun ¶ added in v0.0.76
func (*Telemetry) IsTelemetryEnabled ¶
Click to show internal directories.
Click to hide internal directories.