Documentation ¶
Index ¶
- Variables
- func AcceptTerms() error
- func GetAnonID() string
- func LoadProjectNameWithFallback(ctx context.Context, loader Loader, provider Provider) (string, error)
- func TermsAccepted() bool
- type AccountInfo
- type BootstrapCommandRequest
- type ErrNotImplemented
- type FabricClient
- type GrpcClient
- func (g GrpcClient) AgreeToS(ctx context.Context) error
- func (g GrpcClient) CanIUse(ctx context.Context, req *defangv1.CanIUseRequest) (*defangv1.CanIUseResponse, error)
- func (g GrpcClient) CheckLoginAndToS(ctx context.Context) error
- func (g GrpcClient) Debug(ctx context.Context, req *defangv1.DebugRequest) (*defangv1.DebugResponse, error)
- func (g GrpcClient) DelegateSubdomainZone(ctx context.Context, req *defangv1.DelegateSubdomainZoneRequest) (*defangv1.DelegateSubdomainZoneResponse, error)
- func (g GrpcClient) DeleteSubdomainZone(ctx context.Context) error
- func (g GrpcClient) GenerateFiles(ctx context.Context, req *defangv1.GenerateFilesRequest) (*defangv1.GenerateFilesResponse, error)
- func (g GrpcClient) GetDelegateSubdomainZone(ctx context.Context) (*defangv1.DelegateSubdomainZoneResponse, error)
- func (g GrpcClient) GetSelectedProvider(ctx context.Context, req *defangv1.GetSelectedProviderRequest) (*defangv1.GetSelectedProviderResponse, error)
- func (g GrpcClient) GetVersions(ctx context.Context) (*defangv1.Version, error)
- func (g GrpcClient) ListDeployments(ctx context.Context, req *defangv1.ListDeploymentsRequest) (*defangv1.ListDeploymentsResponse, error)
- func (g GrpcClient) Publish(ctx context.Context, req *defangv1.PublishRequest) error
- func (g GrpcClient) PutDeployment(ctx context.Context, req *defangv1.PutDeploymentRequest) error
- func (g GrpcClient) RevokeToken(ctx context.Context) error
- func (g *GrpcClient) SetClient(client defangv1connect.FabricControllerClient)
- func (g GrpcClient) SetSelectedProvider(ctx context.Context, req *defangv1.SetSelectedProviderRequest) error
- func (g GrpcClient) Token(ctx context.Context, req *defangv1.TokenRequest) (*defangv1.TokenResponse, error)
- func (g GrpcClient) Track(event string, properties ...Property) error
- func (g GrpcClient) VerifyDNSSetup(ctx context.Context, req *defangv1.VerifyDNSSetupRequest) error
- func (g GrpcClient) WhoAmI(ctx context.Context) (*defangv1.WhoAmIResponse, error)
- type Loader
- type MockFabricClient
- func (m MockFabricClient) CanIUse(ctx context.Context, req *defangv1.CanIUseRequest) (*defangv1.CanIUseResponse, error)
- func (m MockFabricClient) DelegateSubdomainZone(context.Context, *defangv1.DelegateSubdomainZoneRequest) (*defangv1.DelegateSubdomainZoneResponse, error)
- func (m MockFabricClient) DeleteSubdomainZone(ctx context.Context) error
- func (m MockFabricClient) GetDelegateSubdomainZone(ctx context.Context) (*defangv1.DelegateSubdomainZoneResponse, error)
- func (m MockFabricClient) ListDeployments(ctx context.Context, req *defangv1.ListDeploymentsRequest) (*defangv1.ListDeploymentsResponse, error)
- func (m MockFabricClient) PutDeployment(ctx context.Context, req *defangv1.PutDeploymentRequest) error
- type MockLoader
- type MockProvider
- func (m MockProvider) CreateUploadURL(ctx context.Context, req *defangv1.UploadURLRequest) (*defangv1.UploadURLResponse, error)
- func (m MockProvider) Follow(ctx context.Context, req *defangv1.TailRequest) (ServerStream[defangv1.TailResponse], error)
- func (m MockProvider) ListConfig(ctx context.Context, req *defangv1.ListConfigsRequest) (*defangv1.Secrets, error)
- func (m MockProvider) ServiceDNS(service string) string
- type MockServerStream
- type PlaygroundAccountInfo
- type PlaygroundProvider
- func (g *PlaygroundProvider) AccountInfo(ctx context.Context) (AccountInfo, error)
- func (g *PlaygroundProvider) BootstrapCommand(ctx context.Context, req BootstrapCommandRequest) (types.ETag, error)
- func (g *PlaygroundProvider) BootstrapList(context.Context) ([]string, error)
- func (g *PlaygroundProvider) CreateUploadURL(ctx context.Context, req *defangv1.UploadURLRequest) (*defangv1.UploadURLResponse, error)
- func (g *PlaygroundProvider) Delete(ctx context.Context, req *defangv1.DeleteRequest) (*defangv1.DeleteResponse, error)
- func (g *PlaygroundProvider) DeleteConfig(ctx context.Context, req *defangv1.Secrets) error
- func (g *PlaygroundProvider) Deploy(ctx context.Context, req *defangv1.DeployRequest) (*defangv1.DeployResponse, error)
- func (g *PlaygroundProvider) Destroy(ctx context.Context, req *defangv1.DestroyRequest) (types.ETag, error)
- func (g *PlaygroundProvider) Follow(ctx context.Context, req *defangv1.TailRequest) (ServerStream[defangv1.TailResponse], error)
- func (g *PlaygroundProvider) GetService(ctx context.Context, req *defangv1.GetRequest) (*defangv1.ServiceInfo, error)
- func (g *PlaygroundProvider) GetServices(ctx context.Context, req *defangv1.GetServicesRequest) (*defangv1.GetServicesResponse, error)
- func (g *PlaygroundProvider) ListConfig(ctx context.Context, req *defangv1.ListConfigsRequest) (*defangv1.Secrets, error)
- func (g *PlaygroundProvider) PrepareDomainDelegation(ctx context.Context, req PrepareDomainDelegationRequest) (*PrepareDomainDelegationResponse, error)
- func (g *PlaygroundProvider) Preview(ctx context.Context, req *defangv1.DeployRequest) (*defangv1.DeployResponse, error)
- func (g *PlaygroundProvider) PutConfig(ctx context.Context, req *defangv1.PutConfigRequest) error
- func (g *PlaygroundProvider) Query(ctx context.Context, req *defangv1.DebugRequest) error
- func (g PlaygroundProvider) RemoteProjectName(ctx context.Context) (string, error)
- func (g PlaygroundProvider) ServiceDNS(name string) string
- func (g *PlaygroundProvider) SetCDImage(string)
- func (g *PlaygroundProvider) Subscribe(ctx context.Context, req *defangv1.SubscribeRequest) (ServerStream[defangv1.SubscribeResponse], error)
- func (g *PlaygroundProvider) TearDown(ctx context.Context) error
- type PrepareDomainDelegationRequest
- type PrepareDomainDelegationResponse
- type ProjectLoader
- type Property
- type Provider
- type ProviderID
- type Retrier
- type ServerStream
- type State
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // StateDir is the directory where the state file is stored StateDir = filepath.Join(stateDir, "defang") )
Functions ¶
func AcceptTerms ¶
func AcceptTerms() error
func TermsAccepted ¶
func TermsAccepted() bool
Types ¶
type AccountInfo ¶
type AccountInfo interface { AccountID() string Details() string Provider() ProviderID Region() string }
type BootstrapCommandRequest ¶
type ErrNotImplemented ¶
type ErrNotImplemented string
func (ErrNotImplemented) Error ¶
func (n ErrNotImplemented) Error() string
type FabricClient ¶
type FabricClient interface { AgreeToS(context.Context) error CanIUse(context.Context, *defangv1.CanIUseRequest) (*defangv1.CanIUseResponse, error) CheckLoginAndToS(context.Context) error Debug(context.Context, *defangv1.DebugRequest) (*defangv1.DebugResponse, error) DelegateSubdomainZone(context.Context, *defangv1.DelegateSubdomainZoneRequest) (*defangv1.DelegateSubdomainZoneResponse, error) DeleteSubdomainZone(context.Context) error GenerateFiles(context.Context, *defangv1.GenerateFilesRequest) (*defangv1.GenerateFilesResponse, error) GetDelegateSubdomainZone(context.Context) (*defangv1.DelegateSubdomainZoneResponse, error) GetSelectedProvider(context.Context, *defangv1.GetSelectedProviderRequest) (*defangv1.GetSelectedProviderResponse, error) GetVersions(context.Context) (*defangv1.Version, error) Publish(context.Context, *defangv1.PublishRequest) error PutDeployment(context.Context, *defangv1.PutDeploymentRequest) error ListDeployments(context.Context, *defangv1.ListDeploymentsRequest) (*defangv1.ListDeploymentsResponse, error) RevokeToken(context.Context) error SetSelectedProvider(context.Context, *defangv1.SetSelectedProviderRequest) error // Subscribe(context.Context, *v1.SubscribeRequest) (*v1.SubscribeResponse, error) Token(context.Context, *defangv1.TokenRequest) (*defangv1.TokenResponse, error) Track(string, ...Property) error VerifyDNSSetup(context.Context, *defangv1.VerifyDNSSetupRequest) error WhoAmI(context.Context) (*defangv1.WhoAmIResponse, error) }
type GrpcClient ¶
type GrpcClient struct { TenantName types.TenantName // contains filtered or unexported fields }
func NewGrpcClient ¶
func NewGrpcClient(host, accessToken string, tenantName types.TenantName) GrpcClient
func (GrpcClient) CanIUse ¶
func (g GrpcClient) CanIUse(ctx context.Context, req *defangv1.CanIUseRequest) (*defangv1.CanIUseResponse, error)
func (GrpcClient) CheckLoginAndToS ¶
func (g GrpcClient) CheckLoginAndToS(ctx context.Context) error
func (GrpcClient) Debug ¶
func (g GrpcClient) Debug(ctx context.Context, req *defangv1.DebugRequest) (*defangv1.DebugResponse, error)
func (GrpcClient) DelegateSubdomainZone ¶
func (g GrpcClient) DelegateSubdomainZone(ctx context.Context, req *defangv1.DelegateSubdomainZoneRequest) (*defangv1.DelegateSubdomainZoneResponse, error)
func (GrpcClient) DeleteSubdomainZone ¶
func (g GrpcClient) DeleteSubdomainZone(ctx context.Context) error
func (GrpcClient) GenerateFiles ¶
func (g GrpcClient) GenerateFiles(ctx context.Context, req *defangv1.GenerateFilesRequest) (*defangv1.GenerateFilesResponse, error)
func (GrpcClient) GetDelegateSubdomainZone ¶
func (g GrpcClient) GetDelegateSubdomainZone(ctx context.Context) (*defangv1.DelegateSubdomainZoneResponse, error)
func (GrpcClient) GetSelectedProvider ¶
func (g GrpcClient) GetSelectedProvider(ctx context.Context, req *defangv1.GetSelectedProviderRequest) (*defangv1.GetSelectedProviderResponse, error)
func (GrpcClient) GetVersions ¶
func (GrpcClient) ListDeployments ¶
func (g GrpcClient) ListDeployments(ctx context.Context, req *defangv1.ListDeploymentsRequest) (*defangv1.ListDeploymentsResponse, error)
func (GrpcClient) Publish ¶
func (g GrpcClient) Publish(ctx context.Context, req *defangv1.PublishRequest) error
func (GrpcClient) PutDeployment ¶
func (g GrpcClient) PutDeployment(ctx context.Context, req *defangv1.PutDeploymentRequest) error
func (GrpcClient) RevokeToken ¶
func (g GrpcClient) RevokeToken(ctx context.Context) error
func (*GrpcClient) SetClient ¶
func (g *GrpcClient) SetClient(client defangv1connect.FabricControllerClient)
func (GrpcClient) SetSelectedProvider ¶
func (g GrpcClient) SetSelectedProvider(ctx context.Context, req *defangv1.SetSelectedProviderRequest) error
func (GrpcClient) Token ¶
func (g GrpcClient) Token(ctx context.Context, req *defangv1.TokenRequest) (*defangv1.TokenResponse, error)
func (GrpcClient) VerifyDNSSetup ¶
func (g GrpcClient) VerifyDNSSetup(ctx context.Context, req *defangv1.VerifyDNSSetupRequest) error
func (GrpcClient) WhoAmI ¶
func (g GrpcClient) WhoAmI(ctx context.Context) (*defangv1.WhoAmIResponse, error)
type MockFabricClient ¶
type MockFabricClient struct { FabricClient DelegateDomain string }
func (MockFabricClient) CanIUse ¶
func (m MockFabricClient) CanIUse(ctx context.Context, req *defangv1.CanIUseRequest) (*defangv1.CanIUseResponse, error)
func (MockFabricClient) DelegateSubdomainZone ¶
func (m MockFabricClient) DelegateSubdomainZone(context.Context, *defangv1.DelegateSubdomainZoneRequest) (*defangv1.DelegateSubdomainZoneResponse, error)
func (MockFabricClient) DeleteSubdomainZone ¶
func (m MockFabricClient) DeleteSubdomainZone(ctx context.Context) error
func (MockFabricClient) GetDelegateSubdomainZone ¶
func (m MockFabricClient) GetDelegateSubdomainZone(ctx context.Context) (*defangv1.DelegateSubdomainZoneResponse, error)
func (MockFabricClient) ListDeployments ¶
func (m MockFabricClient) ListDeployments(ctx context.Context, req *defangv1.ListDeploymentsRequest) (*defangv1.ListDeploymentsResponse, error)
func (MockFabricClient) PutDeployment ¶
func (m MockFabricClient) PutDeployment(ctx context.Context, req *defangv1.PutDeploymentRequest) error
type MockLoader ¶
type MockLoader struct {
Project *composeTypes.Project
}
func (MockLoader) LoadProject ¶
func (m MockLoader) LoadProject(ctx context.Context) (*composeTypes.Project, error)
func (MockLoader) LoadProjectName ¶
func (m MockLoader) LoadProjectName(ctx context.Context) (string, error)
type MockProvider ¶
type MockProvider struct { Provider UploadUrl string ServerStream ServerStream[defangv1.TailResponse] }
func (MockProvider) CreateUploadURL ¶
func (m MockProvider) CreateUploadURL(ctx context.Context, req *defangv1.UploadURLRequest) (*defangv1.UploadURLResponse, error)
func (MockProvider) Follow ¶
func (m MockProvider) Follow(ctx context.Context, req *defangv1.TailRequest) (ServerStream[defangv1.TailResponse], error)
func (MockProvider) ListConfig ¶
func (m MockProvider) ListConfig(ctx context.Context, req *defangv1.ListConfigsRequest) (*defangv1.Secrets, error)
func (MockProvider) ServiceDNS ¶
func (m MockProvider) ServiceDNS(service string) string
type MockServerStream ¶
type MockServerStream struct { Resps []*defangv1.TailResponse Errs []error }
func (*MockServerStream) Close ¶
func (m *MockServerStream) Close() error
func (*MockServerStream) Err ¶
func (m *MockServerStream) Err() error
func (*MockServerStream) Msg ¶
func (m *MockServerStream) Msg() *defangv1.TailResponse
func (*MockServerStream) Receive ¶
func (m *MockServerStream) Receive() bool
type PlaygroundAccountInfo ¶
type PlaygroundAccountInfo struct{}
func (PlaygroundAccountInfo) AccountID ¶
func (g PlaygroundAccountInfo) AccountID() string
func (PlaygroundAccountInfo) Details ¶
func (g PlaygroundAccountInfo) Details() string
func (PlaygroundAccountInfo) Provider ¶
func (g PlaygroundAccountInfo) Provider() ProviderID
func (PlaygroundAccountInfo) Region ¶
func (g PlaygroundAccountInfo) Region() string
type PlaygroundProvider ¶
type PlaygroundProvider struct {
GrpcClient
}
func (*PlaygroundProvider) AccountInfo ¶
func (g *PlaygroundProvider) AccountInfo(ctx context.Context) (AccountInfo, error)
func (*PlaygroundProvider) BootstrapCommand ¶
func (g *PlaygroundProvider) BootstrapCommand(ctx context.Context, req BootstrapCommandRequest) (types.ETag, error)
func (*PlaygroundProvider) BootstrapList ¶
func (g *PlaygroundProvider) BootstrapList(context.Context) ([]string, error)
func (*PlaygroundProvider) CreateUploadURL ¶
func (g *PlaygroundProvider) CreateUploadURL(ctx context.Context, req *defangv1.UploadURLRequest) (*defangv1.UploadURLResponse, error)
func (*PlaygroundProvider) Delete ¶
func (g *PlaygroundProvider) Delete(ctx context.Context, req *defangv1.DeleteRequest) (*defangv1.DeleteResponse, error)
func (*PlaygroundProvider) DeleteConfig ¶
func (*PlaygroundProvider) Deploy ¶
func (g *PlaygroundProvider) Deploy(ctx context.Context, req *defangv1.DeployRequest) (*defangv1.DeployResponse, error)
func (*PlaygroundProvider) Destroy ¶
func (g *PlaygroundProvider) Destroy(ctx context.Context, req *defangv1.DestroyRequest) (types.ETag, error)
func (*PlaygroundProvider) Follow ¶
func (g *PlaygroundProvider) Follow(ctx context.Context, req *defangv1.TailRequest) (ServerStream[defangv1.TailResponse], error)
func (*PlaygroundProvider) GetService ¶
func (g *PlaygroundProvider) GetService(ctx context.Context, req *defangv1.GetRequest) (*defangv1.ServiceInfo, error)
func (*PlaygroundProvider) GetServices ¶
func (g *PlaygroundProvider) GetServices(ctx context.Context, req *defangv1.GetServicesRequest) (*defangv1.GetServicesResponse, error)
func (*PlaygroundProvider) ListConfig ¶
func (g *PlaygroundProvider) ListConfig(ctx context.Context, req *defangv1.ListConfigsRequest) (*defangv1.Secrets, error)
func (*PlaygroundProvider) PrepareDomainDelegation ¶
func (g *PlaygroundProvider) PrepareDomainDelegation(ctx context.Context, req PrepareDomainDelegationRequest) (*PrepareDomainDelegationResponse, error)
func (*PlaygroundProvider) Preview ¶
func (g *PlaygroundProvider) Preview(ctx context.Context, req *defangv1.DeployRequest) (*defangv1.DeployResponse, error)
func (*PlaygroundProvider) PutConfig ¶
func (g *PlaygroundProvider) PutConfig(ctx context.Context, req *defangv1.PutConfigRequest) error
func (*PlaygroundProvider) Query ¶
func (g *PlaygroundProvider) Query(ctx context.Context, req *defangv1.DebugRequest) error
func (PlaygroundProvider) RemoteProjectName ¶
func (g PlaygroundProvider) RemoteProjectName(ctx context.Context) (string, error)
func (PlaygroundProvider) ServiceDNS ¶
func (g PlaygroundProvider) ServiceDNS(name string) string
func (*PlaygroundProvider) SetCDImage ¶
func (g *PlaygroundProvider) SetCDImage(string)
func (*PlaygroundProvider) Subscribe ¶
func (g *PlaygroundProvider) Subscribe(ctx context.Context, req *defangv1.SubscribeRequest) (ServerStream[defangv1.SubscribeResponse], error)
type ProjectLoader ¶
type Provider ¶
type Provider interface { AccountInfo(context.Context) (AccountInfo, error) BootstrapCommand(context.Context, BootstrapCommandRequest) (types.ETag, error) BootstrapList(context.Context) ([]string, error) CreateUploadURL(context.Context, *defangv1.UploadURLRequest) (*defangv1.UploadURLResponse, error) PrepareDomainDelegation(context.Context, PrepareDomainDelegationRequest) (*PrepareDomainDelegationResponse, error) Delete(context.Context, *defangv1.DeleteRequest) (*defangv1.DeleteResponse, error) DeleteConfig(context.Context, *defangv1.Secrets) error Deploy(context.Context, *defangv1.DeployRequest) (*defangv1.DeployResponse, error) Destroy(context.Context, *defangv1.DestroyRequest) (types.ETag, error) Follow(context.Context, *defangv1.TailRequest) (ServerStream[defangv1.TailResponse], error) GetService(context.Context, *defangv1.GetRequest) (*defangv1.ServiceInfo, error) GetServices(context.Context, *defangv1.GetServicesRequest) (*defangv1.GetServicesResponse, error) ListConfig(context.Context, *defangv1.ListConfigsRequest) (*defangv1.Secrets, error) Query(context.Context, *defangv1.DebugRequest) error Preview(context.Context, *defangv1.DeployRequest) (*defangv1.DeployResponse, error) PutConfig(context.Context, *defangv1.PutConfigRequest) error RemoteProjectName(context.Context) (string, error) ServiceDNS(string) string SetCDImage(string) Subscribe(context.Context, *defangv1.SubscribeRequest) (ServerStream[defangv1.SubscribeResponse], error) TearDown(context.Context) error }
type ProviderID ¶
type ProviderID string
const ( ProviderAuto ProviderID = "auto" ProviderDefang ProviderID = "defang" ProviderAWS ProviderID = "aws" ProviderDO ProviderID = "digitalocean" ProviderGCP ProviderID = "gcp" )
func AllProviders ¶
func AllProviders() []ProviderID
func (ProviderID) EnumValue ¶
func (p ProviderID) EnumValue() defangv1.Provider
func (ProviderID) Name ¶
func (p ProviderID) Name() string
func (*ProviderID) Set ¶
func (p *ProviderID) Set(str string) error
func (*ProviderID) SetEnumValue ¶
func (p *ProviderID) SetEnumValue(val defangv1.Provider)
func (ProviderID) String ¶
func (p ProviderID) String() string
func (ProviderID) Type ¶
func (p ProviderID) Type() string
type Retrier ¶
type Retrier struct{}
func (Retrier) WrapStreamingClient ¶
func (Retrier) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc
func (Retrier) WrapStreamingHandler ¶
func (Retrier) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc
type ServerStream ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.