client

package
v0.0.0-...-5e52d11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

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

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
	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 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) AgreeToS

func (g GrpcClient) AgreeToS(ctx context.Context) error

func (GrpcClient) CheckLoginAndToS

func (g GrpcClient) CheckLoginAndToS(ctx context.Context) error

func (GrpcClient) DeleteSubdomainZone

func (g GrpcClient) DeleteSubdomainZone(ctx context.Context) error

func (GrpcClient) GetDelegateSubdomainZone

func (g GrpcClient) GetDelegateSubdomainZone(ctx context.Context) (*defangv1.DelegateSubdomainZoneResponse, error)

func (GrpcClient) GetVersions

func (g GrpcClient) GetVersions(ctx context.Context) (*defangv1.Version, error)

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 (GrpcClient) Track

func (g GrpcClient) Track(event string, properties ...Property) error

func (GrpcClient) WhoAmI

type MockClient

type MockClient struct {
	Client
	UploadUrl string
	Project   *compose.Project
}

func (MockClient) CreateUploadURL

func (MockClient) LoadProject

func (m MockClient) LoadProject() (*compose.Project, error)

func (MockClient) ServiceDNS

func (m MockClient) ServiceDNS(service string) string

type PlaygroundClient

type PlaygroundClient struct {
	GrpcClient
}

func (*PlaygroundClient) BootstrapCommand

func (g *PlaygroundClient) BootstrapCommand(ctx context.Context, command string) (types.ETag, error)

func (*PlaygroundClient) BootstrapList

func (g *PlaygroundClient) BootstrapList(context.Context) ([]string, error)

func (PlaygroundClient) CreateUploadURL

func (PlaygroundClient) Delete

func (PlaygroundClient) DeleteConfig

func (g PlaygroundClient) DeleteConfig(ctx context.Context, req *defangv1.Secrets) error

func (PlaygroundClient) Deploy

func (*PlaygroundClient) Destroy

func (g *PlaygroundClient) Destroy(ctx context.Context) (types.ETag, error)

func (PlaygroundClient) GetService

func (PlaygroundClient) GetServices

func (PlaygroundClient) ListConfig

func (g PlaygroundClient) ListConfig(ctx context.Context) (*defangv1.Secrets, error)

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) Restart

func (g *PlaygroundClient) Restart(ctx context.Context, names ...string) (types.ETag, error)

func (PlaygroundClient) ServiceDNS

func (g PlaygroundClient) ServiceDNS(name string) string

func (*PlaygroundClient) Tail

func (*PlaygroundClient) TearDown

func (g *PlaygroundClient) TearDown(ctx context.Context) error

func (PlaygroundClient) Update

type ProjectLoader

type ProjectLoader interface {
	LoadWithDefaultProjectName(string) (*compose.Project, error)
	LoadWithProjectName(string) (*compose.Project, error)
}

type Property

type Property struct {
	Name  string
	Value any
}

type Provider

type Provider string
const (
	ProviderAuto   Provider = "auto"
	ProviderDefang Provider = "defang"
	ProviderAWS    Provider = "aws"
	ProviderDO     Provider = "do"
)

func (*Provider) Set

func (p *Provider) Set(str string) error

func (Provider) String

func (p Provider) String() string

func (Provider) Type

func (p Provider) Type() string

type ServerStream

type ServerStream[Res any] interface {
	Close() error
	Receive() bool
	Msg() *Res
	Err() error
}

type State

type State struct {
	AnonID string
}

Directories

Path Synopsis
aws
do

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL