cli

package
v0.0.0-...-d41b4a9 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 43 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultCluster = "fabric-prod1.defang.dev"
View Source
const (
	MiB = 1024 * 1024
)
View Source
const (
	RFC3339Micro = "2006-01-02T15:04:05.000000Z07:00" // like RFC3339Nano but with 6 digits of precision
)

Variables

View Source
var (
	DoDryRun = false

	ErrDryRun = errors.New("dry run")
)
View Source
var (
	DoVerbose = false
)
View Source
var ErrTermsNotAgreed = errors.New("You must agree to the Defang terms of service to use this tool")

Functions

func BootstrapCommand

func BootstrapCommand(ctx context.Context, client client.Client, command string) error

func BootstrapList

func BootstrapList(ctx context.Context, client client.Client) error

func ComposeDown

func ComposeDown(ctx context.Context, client client.Client) (client.ETag, error)

func ComposeRestart

func ComposeRestart(ctx context.Context, client client.Client, project *composeTypes.Project) error

func ComposeStart

func ComposeStart(ctx context.Context, c client.Client, project *compose.Project, force bool) (*defangv1.DeployResponse, error)

ComposeStart validates a compose project and uploads the services using the client

func ComposeStop

func ComposeStop(ctx context.Context, client client.Client, project *composeTypes.Project) (client.ETag, error)

func Connect

func Connect(cluster string) (*client.GrpcClient, types.TenantID)

func Delete deprecated

func Delete(ctx context.Context, client client.Client, names ...string) (client.ETag, error)

Deprecated: Use ComposeStop instead.

func Generate

func Generate(ctx context.Context, client client.Client, language string, description string) ([]string, error)

func GenerateLetsEncryptCert

func GenerateLetsEncryptCert(ctx context.Context, client cliClient.Client) error

func GetExistingToken

func GetExistingToken(fabric string) string

func GetServices

func GetServices(ctx context.Context, client client.Client, long bool) error

func GetTenantID deprecated

func GetTenantID(cluster string) types.TenantID

Deprecated: should use grpc to get the tenant ID

func GetVersion

func GetVersion(ctx context.Context, client client.Client) (string, error)

func InteractiveAgreeToS

func InteractiveAgreeToS(ctx context.Context, client client.Client) error

func InteractiveLogin

func InteractiveLogin(ctx context.Context, client client.Client, gitHubClientId, fabric string) error

func LoadCompose

func LoadCompose(filePath string, tenantID types.TenantID) (*compose.Project, error)

func LoadComposeWithProjectName

func LoadComposeWithProjectName(filePath string, projectName string) (*compose.Project, error)

func Logout

func Logout(ctx context.Context, client client.Client) error

func MarshalPretty

func MarshalPretty(root string, data proto.Message) ([]byte, error)

func NewClient

func NewClient(cluster string, projectName string, provider client.Provider) client.Client

func NonInteractiveAgreeToS

func NonInteractiveAgreeToS(ctx context.Context, client client.Client) error

func NonInteractiveLogin

func NonInteractiveLogin(ctx context.Context, client client.Client, fabric string) error

func NormalizeServiceName

func NormalizeServiceName(s string) string

func ParseTimeOrDuration

func ParseTimeOrDuration(str string) (time.Time, error)

ParseTimeOrDuration parses a time string or duration string (e.g. 1h30m) and returns a time.Time. At a minimum, this function supports RFC3339Nano, Go durations, and our own TimestampFormat (local).

func PrintObject

func PrintObject(root string, data proto.Message) error

func Restart

func Restart(ctx context.Context, client client.Client, names ...string) error

func SecretsDelete

func SecretsDelete(ctx context.Context, client client.Client, names ...string) error

func SecretsList

func SecretsList(ctx context.Context, client client.Client) error

func SecretsSet

func SecretsSet(ctx context.Context, client client.Client, name string, value string) error

func SendMsg

func SendMsg(ctx context.Context, client client.Client, subject, _type, id string, data []byte, contenttype string) error

func SplitTenantHost

func SplitTenantHost(cluster string) (types.TenantID, string)

func Tail

func Tail(ctx context.Context, client client.Client, service, etag string, since time.Time, raw bool) error

func TearDown

func TearDown(ctx context.Context, client client.Client) error

func Token

func Token(ctx context.Context, client client.Client, clientId string, tenant types.TenantID, dur time.Duration, scope scope.Scope) error

func Whoami

func Whoami(ctx context.Context, client client.Client) error

Types

type CancelError

type CancelError struct {
	Service string
	Etag    string
	Last    time.Time
	// contains filtered or unexported fields
}

func (*CancelError) Error

func (cerr *CancelError) Error() string

func (*CancelError) Unwrap

func (cerr *CancelError) Unwrap() error

type ComposeError

type ComposeError struct {
	// contains filtered or unexported fields
}

func (ComposeError) Unwrap

func (e ComposeError) Unwrap() error

type P

type P = client.Property // shorthand for tracking properties

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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