Documentation ¶
Index ¶
- func DestroyCluster(ctx context.Context, api API, clusterId string) error
- func DialEndpoint(ctx context.Context, endpoint string) (net.Conn, error)
- func DialEndpointWithToken(ctx context.Context, token fnapi.Token, endpoint string) (net.Conn, error)
- func DialHostedServiceWithToken(ctx context.Context, token fnapi.Token, cluster *KubernetesCluster, ...) (net.Conn, error)
- func DialPort(ctx context.Context, cluster *KubernetesCluster, targetPort int) (net.Conn, error)
- func DialPortWithToken(ctx context.Context, token fnapi.Token, cluster *KubernetesCluster, ...) (net.Conn, error)
- func Register()
- func RegistryCreds(ctx context.Context) (*authn.Basic, error)
- func SetupFlags(prefix string, flags *pflag.FlagSet, hide bool)
- func StartRefreshing(ctx context.Context, api API, clusterId string, handle func(error) error) error
- func TailClusterLogs(ctx context.Context, api API, opts *LogsOpts, handle func(LogBlock) error) error
- type API
- type Attachment
- type BuildCluster
- type BuildCluster_ColocatedPort
- type ClusterShape
- type Cluster_ServiceState
- type ComposeRequest
- type Container
- type ContainerPort
- type ContainerRequest
- type Container_ExportedContainerPort
- type CreateClusterOpts
- type CreateClusterResult
- func CreateAndWaitCluster(ctx context.Context, api API, opts CreateClusterOpts) (*CreateClusterResult, error)
- func EnsureBuildCluster(ctx context.Context, api API, opts EnsureBuildClusterOpts) (*CreateClusterResult, error)
- func WaitCluster(ctx context.Context, api API, clusterId string, opts WaitClusterOpts) (*CreateClusterResult, error)
- type CreateContainersRequest
- type CreateContainersResponse
- type CreateKubernetesClusterRequest
- type CreateKubernetesClusterResponse
- type DestroyKubernetesClusterRequest
- type EnsureBuildClusterOpts
- type GetImageRegistryResponse
- type GetKubernetesClusterRequest
- type GetKubernetesClusterResponse
- type GetKubernetesConfigRequest
- type GetKubernetesConfigResponse
- type GetLogsRequest
- type GetLogsResponse
- type GetProfileResponse
- type GithubWorkflowInfo
- type ImageRegistry
- type IngressBackendEndpoint
- type KubernetesCluster
- type KubernetesClusterMetadata
- type LabelEntry
- type ListKubernetesClustersRequest
- type ListKubernetesClustersResponse
- type LogBlock
- type LogLine
- type LogsOpts
- type LogsSelector
- type RefreshKubernetesClusterRequest
- type RefreshKubernetesClusterResponse
- type RegisterDefaultIngressRequest
- type RegisterDefaultIngressResponse
- type ReleaseKubernetesClusterRequest
- type StartContainersRequest
- type StartContainersResponse
- type StartCreateKubernetesClusterResponse
- type TailLogsRequest
- type WaitClusterOpts
- type WaitKubernetesClusterRequest
- type WakeKubernetesClusterRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DialEndpoint ¶ added in v0.0.188
func DialEndpointWithToken ¶ added in v0.0.188
func DialHostedServiceWithToken ¶ added in v0.0.202
func DialPortWithToken ¶ added in v0.0.165
func RegistryCreds ¶ added in v0.0.166
func StartRefreshing ¶ added in v0.0.181
Types ¶
type API ¶ added in v0.0.103
type API struct { StartCreateKubernetesCluster fnapi.Call[CreateKubernetesClusterRequest] CreateContainers fnapi.Call[CreateContainersRequest] StartContainers fnapi.Call[StartContainersRequest] GetKubernetesCluster fnapi.Call[GetKubernetesClusterRequest] WaitKubernetesCluster fnapi.Call[WaitKubernetesClusterRequest] ListKubernetesClusters fnapi.Call[ListKubernetesClustersRequest] DestroyKubernetesCluster fnapi.Call[DestroyKubernetesClusterRequest] ReleaseKubernetesCluster fnapi.Call[ReleaseKubernetesClusterRequest] WakeKubernetesCluster fnapi.Call[WakeKubernetesClusterRequest] RefreshKubernetesCluster fnapi.Call[RefreshKubernetesClusterRequest] GetKubernetesConfig fnapi.Call[GetKubernetesConfigRequest] GetImageRegistry fnapi.Call[emptypb.Empty] TailClusterLogs fnapi.Call[TailLogsRequest] GetClusterLogs fnapi.Call[GetLogsRequest] GetProfile fnapi.Call[emptypb.Empty] RegisterDefaultIngress fnapi.Call[RegisterDefaultIngressRequest] }
var Endpoint API
type Attachment ¶ added in v0.0.167
type BuildCluster ¶
type BuildCluster struct {
Colocated *BuildCluster_ColocatedPort `json:"colocated,omitempty"`
}
type ClusterShape ¶
type Cluster_ServiceState ¶ added in v0.0.188
type Cluster_ServiceState struct { Name string `json:"name,omitempty"` Status string `json:"status,omitempty"` Endpoint string `json:"endpoint,omitempty"` // Service-specific endpoint. Public bool `json:"public,omitempty"` }
func ClusterService ¶ added in v0.0.188
func ClusterService(cluster *KubernetesCluster, name string) *Cluster_ServiceState
type ComposeRequest ¶ added in v0.0.203
type ComposeRequest struct {
Contents []byte `json:"contents,omitempty"`
}
type Container ¶ added in v0.0.203
type Container struct { Id string `json:"id,omitempty"` Name string `json:"name,omitempty"` ExportedPort []*Container_ExportedContainerPort `json:"exported_port,omitempty"` }
type ContainerPort ¶ added in v0.0.203
type ContainerRequest ¶ added in v0.0.197
type ContainerRequest struct { Name string `json:"name,omitempty"` Image string `json:"image,omitempty"` Args []string `json:"args,omitempty"` Flag []string `json:"flag,omitempty"` ExportPort []*ContainerPort `json:"export_port,omitempty"` }
type Container_ExportedContainerPort ¶ added in v0.0.203
type CreateClusterOpts ¶ added in v0.0.135
type CreateClusterOpts struct { MachineType string Ephemeral bool // Whether to keep the cluster alive, regardless of it being ephemeral. // This is typically needed if you want to execute multiple ns commands on an ephemeral cluster. KeepAtExit bool Purpose string Features []string AuthorizedSshKeys []string UniqueTag string WaitClusterOpts }
type CreateClusterResult ¶
type CreateClusterResult struct { ClusterId string Cluster *KubernetesCluster Registry *ImageRegistry BuildCluster *BuildCluster Deadline *time.Time }
func CreateAndWaitCluster ¶
func CreateAndWaitCluster(ctx context.Context, api API, opts CreateClusterOpts) (*CreateClusterResult, error)
func EnsureBuildCluster ¶ added in v0.0.166
func EnsureBuildCluster(ctx context.Context, api API, opts EnsureBuildClusterOpts) (*CreateClusterResult, error)
func WaitCluster ¶
func WaitCluster(ctx context.Context, api API, clusterId string, opts WaitClusterOpts) (*CreateClusterResult, error)
type CreateContainersRequest ¶ added in v0.0.197
type CreateContainersRequest struct { MachineType string `json:"machine_type,omitempty"` Container []*ContainerRequest `json:"container,omitempty"` Compose []*ComposeRequest `json:"compose,omitempty"` }
type CreateContainersResponse ¶ added in v0.0.197
type CreateKubernetesClusterRequest ¶
type CreateKubernetesClusterRequest struct { Ephemeral bool `json:"ephemeral,omitempty"` DocumentedPurpose string `json:"documented_purpose,omitempty"` AuthorizedSshKeys []string `json:"authorized_ssh_keys,omitempty"` MachineType string `json:"machine_type,omitempty"` Feature []string `json:"feature,omitempty"` UniqueTag string `json:"unique_tag,omitempty"` }
type CreateKubernetesClusterResponse ¶
type CreateKubernetesClusterResponse struct { Status string `json:"status,omitempty"` ClusterId string `json:"cluster_id,omitempty"` Cluster *KubernetesCluster `json:"cluster,omitempty"` Registry *ImageRegistry `json:"registry,omitempty"` BuildCluster *BuildCluster `json:"build_cluster,omitempty"` Deadline string `json:"deadline,omitempty"` }
type DestroyKubernetesClusterRequest ¶
type DestroyKubernetesClusterRequest struct {
ClusterId string `json:"cluster_id,omitempty"`
}
type EnsureBuildClusterOpts ¶ added in v0.0.197
type EnsureBuildClusterOpts struct {
Features []string
}
type GetImageRegistryResponse ¶ added in v0.0.183
type GetImageRegistryResponse struct { Registry *ImageRegistry `json:"registry,omitempty"` NSCR *ImageRegistry `json:"nscr,omitempty"` }
func GetImageRegistry ¶ added in v0.0.183
func GetImageRegistry(ctx context.Context, api API) (*GetImageRegistryResponse, error)
type GetKubernetesClusterRequest ¶
type GetKubernetesClusterRequest struct {
ClusterId string `json:"cluster_id,omitempty"`
}
type GetKubernetesClusterResponse ¶
type GetKubernetesClusterResponse struct { Cluster *KubernetesCluster `json:"cluster,omitempty"` Registry *ImageRegistry `json:"registry,omitempty"` BuildCluster *BuildCluster `json:"build_cluster,omitempty"` Deadline string `json:"deadline,omitempty"` }
func GetCluster ¶
type GetKubernetesConfigRequest ¶ added in v0.0.197
type GetKubernetesConfigRequest struct {
ClusterId string `json:"cluster_id,omitempty"`
}
type GetKubernetesConfigResponse ¶ added in v0.0.197
type GetKubernetesConfigResponse struct {
Kubeconfig string `json:"kubeconfig,omitempty"`
}
func GetKubernetesConfig ¶ added in v0.0.197
type GetLogsRequest ¶ added in v0.0.168
type GetLogsRequest struct { ClusterID string `json:"cluster_id,omitempty"` StartTs *time.Time `json:"start_ts,omitempty"` EndTs *time.Time `json:"end_ts,omitempty"` Include []*LogsSelector `json:"include,omitempty"` Exclude []*LogsSelector `json:"exclude,omitempty"` }
type GetLogsResponse ¶ added in v0.0.168
type GetLogsResponse struct {
LogBlock []LogBlock `json:"log_block,omitempty"`
}
func GetClusterLogs ¶ added in v0.0.168
type GetProfileResponse ¶ added in v0.0.198
type GetProfileResponse struct {
ClusterPlatform []string `json:"cluster_platform,omitempty"`
}
func GetProfile ¶ added in v0.0.198
func GetProfile(ctx context.Context, api API) (*GetProfileResponse, error)
type GithubWorkflowInfo ¶ added in v0.0.175
type GithubWorkflowInfo struct { Repository string `json:"repository,omitempty"` RunId string `json:"run_id,omitempty"` RunAttempt string `json:"run_attempt,omitempty"` Sha string `json:"sha,omitempty"` Ref string `json:"ref,omitempty"` Actor string `json:"actor,omitempty"` Workflow string `json:"workflow,omitempty"` }
type ImageRegistry ¶
type IngressBackendEndpoint ¶ added in v0.0.200
type KubernetesCluster ¶
type KubernetesCluster struct { AppURL string `json:"app_url,omitempty"` ClusterId string `json:"cluster_id,omitempty"` Created string `json:"created,omitempty"` DestroyedAt string `json:"destroyed_at,omitempty"` Deadline string `json:"deadline,omitempty"` SSHProxyEndpoint string `json:"ssh_proxy_endpoint,omitempty"` SshPrivateKey []byte `json:"ssh_private_key,omitempty"` DocumentedPurpose string `json:"documented_purpose,omitempty"` Shape *ClusterShape `json:"shape,omitempty"` EndpointAddress string `json:"endpoint_address,omitempty"` CertificateAuthorityData []byte `json:"certificate_authority_data,omitempty"` ClientCertificateData []byte `json:"client_certificate_data,omitempty"` ClientKeyData []byte `json:"client_key_data,omitempty"` KubernetesDistribution string `json:"kubernetes_distribution,omitempty"` Platform []string `json:"platform,omitempty"` IngressDomain string `json:"ingress_domain,omitempty"` Label []*LabelEntry `json:"label,omitempty"` CreatorId string `json:"creator_id,omitempty"` GithubWorkflow *GithubWorkflowInfo `json:"github_workflow,omitempty"` ServiceState []*Cluster_ServiceState `json:"service_state,omitempty"` }
type KubernetesClusterMetadata ¶ added in v0.0.176
type KubernetesClusterMetadata struct { ClusterId string `json:"cluster_id,omitempty"` Created string `json:"created,omitempty"` DestroyedAt string `json:"destroyed_at,omitempty"` Deadline string `json:"deadline,omitempty"` DocumentedPurpose string `json:"documented_purpose,omitempty"` Shape *ClusterShape `json:"shape,omitempty"` KubernetesDistribution string `json:"kubernetes_distribution,omitempty"` Platform []string `json:"platform,omitempty"` IngressDomain string `json:"ingress_domain,omitempty"` Label []*LabelEntry `json:"label,omitempty"` CreatorId string `json:"creator_id,omitempty"` GithubWorkflow *GithubWorkflowInfo `json:"github_workflow,omitempty"` }
type LabelEntry ¶
type ListKubernetesClustersResponse ¶ added in v0.0.176
type ListKubernetesClustersResponse struct {
Clusters []KubernetesClusterMetadata `json:"cluster"`
}
func ListClusters ¶
type LogLine ¶ added in v0.0.168
type LogsOpts ¶ added in v0.0.168
type LogsOpts struct { ClusterID string StartTs *time.Time EndTs *time.Time Include []*LogsSelector Exclude []*LogsSelector }
type LogsSelector ¶ added in v0.0.168
type RefreshKubernetesClusterRequest ¶ added in v0.0.181
type RefreshKubernetesClusterRequest struct {
ClusterId string `json:"cluster_id,omitempty"`
}
type RefreshKubernetesClusterResponse ¶ added in v0.0.181
type RefreshKubernetesClusterResponse struct {
NewDeadline string `json:"new_deadline,omitempty"`
}
func RefreshCluster ¶ added in v0.0.181
type RegisterDefaultIngressRequest ¶ added in v0.0.200
type RegisterDefaultIngressRequest struct { ClusterId string `json:"cluster_id,omitempty"` Prefix string `json:"prefix,omitempty"` BackendEndpoint *IngressBackendEndpoint `json:"backend_endpoint,omitempty"` }
type RegisterDefaultIngressResponse ¶ added in v0.0.200
type RegisterDefaultIngressResponse struct {
Fqdn string `json:"fqdn,omitempty"`
}
func RegisterDefaultIngress ¶ added in v0.0.200
func RegisterDefaultIngress(ctx context.Context, api API, req RegisterDefaultIngressRequest) (*RegisterDefaultIngressResponse, error)
type ReleaseKubernetesClusterRequest ¶ added in v0.0.187
type ReleaseKubernetesClusterRequest struct {
ClusterId string `json:"cluster_id,omitempty"`
}
type StartContainersRequest ¶ added in v0.0.203
type StartContainersRequest struct { Id string `json:"id,omitempty"` Container []*ContainerRequest `json:"container,omitempty"` }
type StartContainersResponse ¶ added in v0.0.203
type StartContainersResponse struct {
Container []*Container `json:"container,omitempty"`
}
type StartCreateKubernetesClusterResponse ¶
type StartCreateKubernetesClusterResponse struct { ClusterId string `json:"cluster_id,omitempty"` ClusterFragment *KubernetesCluster `json:"cluster_fragment,omitempty"` Registry *ImageRegistry `json:"registry,omitempty"` Deadline string `json:"deadline,omitempty"` }
func CreateCluster ¶
func CreateCluster(ctx context.Context, api API, opts CreateClusterOpts) (*StartCreateKubernetesClusterResponse, error)
type TailLogsRequest ¶ added in v0.0.168
type TailLogsRequest struct { ClusterID string `json:"cluster_id,omitempty"` Include []*LogsSelector `json:"include,omitempty"` Exclude []*LogsSelector `json:"exclude,omitempty"` }
type WaitClusterOpts ¶ added in v0.0.188
type WaitKubernetesClusterRequest ¶
type WaitKubernetesClusterRequest struct {
ClusterId string `json:"cluster_id,omitempty"`
}
type WakeKubernetesClusterRequest ¶ added in v0.0.202
type WakeKubernetesClusterRequest struct {
ClusterId string `json:"cluster_id,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.