Documentation
¶
Index ¶
- Variables
- type Client
- type ErrNotImplemented
- type FabricClient
- type GrpcClient
- func (g GrpcClient) AgreeToS(ctx context.Context) error
- func (g GrpcClient) CheckLoginAndToS(ctx context.Context) 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) GetVersions(ctx context.Context) (*defangv1.Version, error)
- func (g GrpcClient) Publish(ctx context.Context, req *defangv1.PublishRequest) error
- func (g GrpcClient) RevokeToken(ctx context.Context) 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) WhoAmI(ctx context.Context) (*defangv1.WhoAmIResponse, error)
- type MockClient
- func (m MockClient) CreateUploadURL(ctx context.Context, req *defangv1.UploadURLRequest) (*defangv1.UploadURLResponse, error)
- func (m MockClient) LoadProject() (*compose.Project, error)
- func (m MockClient) LoadProjectName() (string, error)
- func (m MockClient) ServiceDNS(service string) string
- func (m MockClient) Tail(ctx context.Context, req *defangv1.TailRequest) (ServerStream[defangv1.TailResponse], error)
- type MockServerStream
- type PlaygroundClient
- func (g *PlaygroundClient) BootstrapCommand(ctx context.Context, command string) (types.ETag, error)
- func (g *PlaygroundClient) BootstrapList(context.Context) ([]string, error)
- func (g PlaygroundClient) CreateUploadURL(ctx context.Context, req *defangv1.UploadURLRequest) (*defangv1.UploadURLResponse, error)
- func (g PlaygroundClient) Delete(ctx context.Context, req *defangv1.DeleteRequest) (*defangv1.DeleteResponse, error)
- func (g PlaygroundClient) DeleteConfig(ctx context.Context, req *defangv1.Secrets) error
- func (g PlaygroundClient) Deploy(ctx context.Context, req *defangv1.DeployRequest) (*defangv1.DeployResponse, error)
- func (g *PlaygroundClient) Destroy(ctx context.Context) (types.ETag, error)
- func (g PlaygroundClient) GetService(ctx context.Context, req *defangv1.ServiceID) (*defangv1.ServiceInfo, error)
- func (g PlaygroundClient) GetServices(ctx context.Context) (*defangv1.ListServicesResponse, error)
- func (g PlaygroundClient) ListConfig(ctx context.Context) (*defangv1.Secrets, error)
- func (g PlaygroundClient) LoadProject() (*compose.Project, error)
- func (g PlaygroundClient) LoadProjectName() (string, error)
- func (g PlaygroundClient) PutConfig(ctx context.Context, req *defangv1.SecretValue) error
- func (g *PlaygroundClient) Restart(ctx context.Context, names ...string) (types.ETag, error)
- func (g PlaygroundClient) ServiceDNS(name string) string
- func (g *PlaygroundClient) Subscribe(ctx context.Context, req *defangv1.SubscribeRequest) (ServerStream[defangv1.SubscribeResponse], error)
- func (g *PlaygroundClient) Tail(ctx context.Context, req *defangv1.TailRequest) (ServerStream[defangv1.TailResponse], error)
- func (g *PlaygroundClient) TearDown(ctx context.Context) error
- type ProjectLoader
- type Property
- type Provider
- 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") GetAnonID = func() string { state := State{AnonID: uuid.NewString()} statePath := filepath.Join(StateDir, "state.json") if bytes, err := os.ReadFile(statePath); err == nil { json.Unmarshal(bytes, &state) } else { if bytes, err := json.MarshalIndent(state, "", " "); err == nil { os.MkdirAll(StateDir, 0700) os.WriteFile(statePath, bytes, 0644) } } return state.AnonID } )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { FabricClient BootstrapCommand(context.Context, string) (types.ETag, error) BootstrapList(context.Context) ([]string, error) CreateUploadURL(context.Context, *defangv1.UploadURLRequest) (*defangv1.UploadURLResponse, error) // Deprecated: Use Deploy or Destroy instead. 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) (types.ETag, error) GetService(context.Context, *defangv1.ServiceID) (*defangv1.ServiceInfo, error) GetServices(context.Context) (*defangv1.ListServicesResponse, error) ListConfig(context.Context) (*defangv1.Secrets, error) PutConfig(context.Context, *defangv1.SecretValue) error Restart(context.Context, ...string) (types.ETag, error) ServiceDNS(name string) string Subscribe(context.Context, *defangv1.SubscribeRequest) (ServerStream[defangv1.SubscribeResponse], error) Tail(context.Context, *defangv1.TailRequest) (ServerStream[defangv1.TailResponse], error) TearDown(context.Context) error WhoAmI(context.Context) (*defangv1.WhoAmIResponse, error) LoadProject() (*compose.Project, error) LoadProjectName() (string, error) // TODO: should probably be a private method }
type ErrNotImplemented ¶
type ErrNotImplemented string
func (ErrNotImplemented) Error ¶
func (n ErrNotImplemented) Error() string
type FabricClient ¶
type FabricClient interface { AgreeToS(context.Context) error CheckLoginAndToS(context.Context) 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) GetVersions(context.Context) (*defangv1.Version, error) Publish(context.Context, *defangv1.PublishRequest) error RevokeToken(context.Context) error // Subscribe(context.Context, *v1.SubscribeRequest) (*v1.SubscribeResponse, error) Token(context.Context, *defangv1.TokenRequest) (*defangv1.TokenResponse, error) Track(string, ...Property) error }
type GrpcClient ¶
type GrpcClient struct { Loader ProjectLoader // contains filtered or unexported fields }
func NewGrpcClient ¶
func NewGrpcClient(host, accessToken string, tenantID types.TenantID, loader ProjectLoader) GrpcClient
func (GrpcClient) CheckLoginAndToS ¶
func (g GrpcClient) CheckLoginAndToS(ctx context.Context) 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) GetVersions ¶
func (GrpcClient) Publish ¶
func (g GrpcClient) Publish(ctx context.Context, req *defangv1.PublishRequest) error
func (GrpcClient) RevokeToken ¶
func (g GrpcClient) RevokeToken(ctx context.Context) error
func (GrpcClient) Token ¶
func (g GrpcClient) Token(ctx context.Context, req *defangv1.TokenRequest) (*defangv1.TokenResponse, error)
func (GrpcClient) WhoAmI ¶
func (g GrpcClient) WhoAmI(ctx context.Context) (*defangv1.WhoAmIResponse, error)
type MockClient ¶
type MockClient struct { Client UploadUrl string Project *compose.Project ServerStream ServerStream[defangv1.TailResponse] }
func (MockClient) CreateUploadURL ¶
func (m MockClient) CreateUploadURL(ctx context.Context, req *defangv1.UploadURLRequest) (*defangv1.UploadURLResponse, error)
func (MockClient) LoadProject ¶
func (m MockClient) LoadProject() (*compose.Project, error)
func (MockClient) LoadProjectName ¶
func (m MockClient) LoadProjectName() (string, error)
func (MockClient) ServiceDNS ¶
func (m MockClient) ServiceDNS(service string) string
func (MockClient) Tail ¶
func (m MockClient) Tail(ctx context.Context, req *defangv1.TailRequest) (ServerStream[defangv1.TailResponse], error)
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 PlaygroundClient ¶
type PlaygroundClient struct {
GrpcClient
}
func (*PlaygroundClient) BootstrapCommand ¶
func (*PlaygroundClient) BootstrapList ¶
func (g *PlaygroundClient) BootstrapList(context.Context) ([]string, error)
func (PlaygroundClient) CreateUploadURL ¶
func (g PlaygroundClient) CreateUploadURL(ctx context.Context, req *defangv1.UploadURLRequest) (*defangv1.UploadURLResponse, error)
func (PlaygroundClient) Delete ¶
func (g PlaygroundClient) Delete(ctx context.Context, req *defangv1.DeleteRequest) (*defangv1.DeleteResponse, error)
func (PlaygroundClient) DeleteConfig ¶
func (PlaygroundClient) Deploy ¶
func (g PlaygroundClient) Deploy(ctx context.Context, req *defangv1.DeployRequest) (*defangv1.DeployResponse, error)
func (PlaygroundClient) GetService ¶
func (g PlaygroundClient) GetService(ctx context.Context, req *defangv1.ServiceID) (*defangv1.ServiceInfo, error)
func (PlaygroundClient) GetServices ¶
func (g PlaygroundClient) GetServices(ctx context.Context) (*defangv1.ListServicesResponse, error)
func (PlaygroundClient) ListConfig ¶
func (PlaygroundClient) LoadProject ¶
func (g PlaygroundClient) LoadProject() (*compose.Project, error)
func (PlaygroundClient) LoadProjectName ¶
func (g PlaygroundClient) LoadProjectName() (string, error)
func (PlaygroundClient) PutConfig ¶
func (g PlaygroundClient) PutConfig(ctx context.Context, req *defangv1.SecretValue) error
func (PlaygroundClient) ServiceDNS ¶
func (g PlaygroundClient) ServiceDNS(name string) string
func (*PlaygroundClient) Subscribe ¶
func (g *PlaygroundClient) Subscribe(ctx context.Context, req *defangv1.SubscribeRequest) (ServerStream[defangv1.SubscribeResponse], error)
func (*PlaygroundClient) Tail ¶
func (g *PlaygroundClient) Tail(ctx context.Context, req *defangv1.TailRequest) (ServerStream[defangv1.TailResponse], error)
type ProjectLoader ¶
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.