client

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

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 21 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

func AcceptTerms

func AcceptTerms() error

func GetAnonID

func GetAnonID() string

func TermsAccepted

func TermsAccepted() bool

Types

type AccountInfo

type AccountInfo interface {
	AccountID() string
	Details() string
	Provider() ProviderID
	Region() string
}

type BootstrapCommandRequest

type BootstrapCommandRequest struct {
	Command string
	Project string
}

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
	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)
	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
	VerifyDNSSetup(context.Context, *defangv1.VerifyDNSSetupRequest) error
	WhoAmI(context.Context) (*defangv1.WhoAmIResponse, error)
}

type GrpcClient

type GrpcClient struct {
	TenantID types.TenantID
	// contains filtered or unexported fields
}

func NewGrpcClient

func NewGrpcClient(host, accessToken string, tenantID types.TenantID) 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) Debug

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

func (g GrpcClient) SetSelectedProvider(ctx context.Context, req *defangv1.SetSelectedProviderRequest) error

func (GrpcClient) Token

func (GrpcClient) Track

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

func (GrpcClient) VerifyDNSSetup

func (g GrpcClient) VerifyDNSSetup(ctx context.Context, req *defangv1.VerifyDNSSetupRequest) error

func (GrpcClient) WhoAmI

type Loader

type Loader interface {
	LoadProject(context.Context) (*composeTypes.Project, error)
	LoadProjectName(context.Context) (string, error)
}

type MockFabricClient

type MockFabricClient struct {
	FabricClient
	DelegateDomain string
}

func (MockFabricClient) DeleteSubdomainZone

func (m MockFabricClient) DeleteSubdomainZone(ctx context.Context) error

func (MockFabricClient) GetDelegateSubdomainZone

func (m MockFabricClient) GetDelegateSubdomainZone(ctx context.Context) (*defangv1.DelegateSubdomainZoneResponse, 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 (MockProvider) Follow

func (MockProvider) ListConfig

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 (*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 (*PlaygroundProvider) Delete

func (*PlaygroundProvider) DeleteConfig

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

func (*PlaygroundProvider) Deploy

func (*PlaygroundProvider) Destroy

func (*PlaygroundProvider) Follow

func (*PlaygroundProvider) GetService

func (*PlaygroundProvider) GetServices

func (*PlaygroundProvider) ListConfig

func (*PlaygroundProvider) PrepareDomainDelegation

func (*PlaygroundProvider) Preview

func (*PlaygroundProvider) PutConfig

func (*PlaygroundProvider) Query

func (PlaygroundProvider) RemoteProjectName

func (g PlaygroundProvider) RemoteProjectName(ctx context.Context) (string, error)

func (PlaygroundProvider) ServiceDNS

func (g PlaygroundProvider) ServiceDNS(name string) string

func (*PlaygroundProvider) Subscribe

func (*PlaygroundProvider) TearDown

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

type PrepareDomainDelegationRequest

type PrepareDomainDelegationRequest struct {
	Project        string
	DelegateDomain string
	Preview        bool
}

type PrepareDomainDelegationResponse

type PrepareDomainDelegationResponse struct {
	NameServers     []string
	DelegationSetId string
}

type ProjectLoader

type ProjectLoader interface {
	LoadProjectName(context.Context) (string, error)
	LoadProject(context.Context) (*composeTypes.Project, error)
}

type Property

type Property struct {
	Name  string
	Value any
}

type Provider

type ProviderID

type ProviderID string
const (
	ProviderAuto   ProviderID = "auto"
	ProviderDefang ProviderID = "defang"
	ProviderAWS    ProviderID = "aws"
	ProviderDO     ProviderID = "digitalocean"
)

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

func (Retrier) WrapUnary

func (Retrier) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc

type ServerStream

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

type State

type State struct {
	AnonID          string
	TermsAcceptedAt time.Time
}

Directories

Path Synopsis
aws
do

Jump to

Keyboard shortcuts

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