Documentation ¶
Index ¶
- Constants
- Variables
- func BootstrapCommand(ctx context.Context, projectName string, c client.FabricClient, ...) error
- func BootstrapLocalList(ctx context.Context, provider client.Provider) error
- func ComposeDown(ctx context.Context, projectName string, c client.FabricClient, ...) (types.ETag, error)
- func ComposeUp(ctx context.Context, project *compose.Project, c client.FabricClient, ...) (*defangv1.DeployResponse, *compose.Project, error)
- func ConfigDelete(ctx context.Context, projectName string, provider client.Provider, ...) error
- func ConfigList(ctx context.Context, projectName string, provider client.Provider) error
- func ConfigSet(ctx context.Context, projectName string, provider client.Provider, name string, ...) error
- func Debug(ctx context.Context, c client.FabricClient, p client.Provider, etag types.ETag, ...) error
- func Delete(ctx context.Context, projectName string, c client.FabricClient, ...) (types.ETag, error)
- func DeploymentsList(ctx context.Context, projectName string, client client.GrpcClient) error
- func GenerateLetsEncryptCert(ctx context.Context, project *compose.Project, client client.FabricClient, ...) error
- func GenerateWithAI(ctx context.Context, client client.FabricClient, ...) ([]string, error)
- func GetExistingToken(fabric string) string
- func GetServices(ctx context.Context, projectName string, provider client.Provider, long bool) error
- func GetVersion(ctx context.Context, client client.FabricClient) (string, error)
- func InitFromSamples(ctx context.Context, dir string, names []string) error
- func InteractiveAgreeToS(ctx context.Context, c client.FabricClient) error
- func InteractiveComposeDown(ctx context.Context, provider client.Provider, projectName string) (types.ETag, error)
- func InteractiveDebug(ctx context.Context, c client.FabricClient, p client.Provider, etag types.ETag, ...) error
- func InteractiveLogin(ctx context.Context, client client.FabricClient, gitHubClientId, fabric string) error
- func IsProjectFile(basename string) bool
- func Logout(ctx context.Context, client client.FabricClient) error
- func MarshalPretty(root string, data proto.Message) ([]byte, error)
- func MixinFromSample(ctx context.Context, dir string, name string) error
- func NewGrpcClient(ctx context.Context, cluster string) client.GrpcClient
- func NewProvider(ctx context.Context, providerID client.ProviderID, ...) (client.Provider, error)
- func NonInteractiveAgreeToS(ctx context.Context, c client.FabricClient) error
- func NonInteractiveLogin(ctx context.Context, client client.FabricClient, fabric string) error
- func ParseTimeOrDuration(str string, now time.Time) (time.Time, error)
- func PrintObject(root string, data proto.Message) error
- func SendMsg(ctx context.Context, client client.FabricClient, subject, _type, id string, ...) error
- func SplitProjectStack(name string) (projectName string, stackName string)
- func SplitTenantHost(cluster string) (types.TenantName, string)
- func Tail(ctx context.Context, provider client.Provider, projectName string, ...) error
- func TearDown(ctx context.Context, provider client.Provider, force bool) error
- func Token(ctx context.Context, client client.FabricClient, clientId string, ...) error
- func Upgrade(ctx context.Context) error
- func WaitServiceState(ctx context.Context, provider client.Provider, ...) error
- func Whoami(ctx context.Context, fabric client.FabricClient, provider client.Provider) (string, error)
- type CancelError
- type ComposeError
- type DNSResult
- type EndLogConditionaldeprecated
- type ErrNoServices
- type HTTPClient
- type PrintConfig
- type PrintDeployment
- type Sample
- type ServiceStatus
- type ShowAccountData
- type TailDetectStopEventFuncdeprecated
- type TailOptions
Constants ¶
View Source
const DefaultCluster = "fabric-prod1.defang.dev"
View Source
const (
RFC3339Milli = "2006-01-02T15:04:05.000Z07:00" // like RFC3339Nano but with 3 digits of precision
)
Variables ¶
View Source
var ( DoDryRun = false ErrDryRun = errors.New("dry run") )
View Source
var DefangFabric = pkg.Getenv("DEFANG_FABRIC", DefaultCluster)
View Source
var (
ErrDebugSkipped = errors.New("debug skipped")
)
View Source
var ErrDoNotComposeDown = errors.New("user did not want to compose down")
View Source
var ErrNothingToMonitor = errors.New("no services to monitor")
View Source
var ErrSampleNotFound = errors.New("sample not found")
View Source
var ErrTermsNotAgreed = errors.New("you must agree to the Defang terms of service to use this tool")
View Source
var P = track.P
View Source
var SupportedLanguages = []string{"Nodejs", "Golang", "Python"}
Functions ¶
func BootstrapCommand ¶
func BootstrapLocalList ¶
func ComposeDown ¶
func ComposeUp ¶
func ComposeUp(ctx context.Context, project *compose.Project, c client.FabricClient, p client.Provider, upload compose.UploadMode, mode defangv1.DeploymentMode) (*defangv1.DeployResponse, *compose.Project, error)
ComposeUp validates a compose project and uploads the services using the client
func ConfigDelete ¶
func ConfigList ¶
func DeploymentsList ¶
func GenerateLetsEncryptCert ¶
func GenerateWithAI ¶
func GetExistingToken ¶
func GetServices ¶
func GetVersion ¶
func InitFromSamples ¶
InitFromSamples copies the sample(s) into the given directory, aborting if any files already exist.
func InteractiveAgreeToS ¶
func InteractiveAgreeToS(ctx context.Context, c client.FabricClient) error
func InteractiveComposeDown ¶
func InteractiveDebug ¶
func InteractiveLogin ¶
func IsProjectFile ¶
func MixinFromSample ¶
MixinFromSamples copies the sample files into the given directory, skipping existing files.
func NewGrpcClient ¶
func NewGrpcClient(ctx context.Context, cluster string) client.GrpcClient
func NewProvider ¶
func NewProvider(ctx context.Context, providerID client.ProviderID, grpcClient client.GrpcClient) (client.Provider, error)
func NonInteractiveAgreeToS ¶
func NonInteractiveAgreeToS(ctx context.Context, c client.FabricClient) error
func NonInteractiveLogin ¶
func ParseTimeOrDuration ¶
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 SplitProjectStack ¶
func SplitTenantHost ¶
func SplitTenantHost(cluster string) (types.TenantName, string)
func WaitServiceState ¶
Types ¶
type CancelError ¶
type CancelError struct { TailOptions ProjectName string // 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 EndLogConditional
deprecated
type ErrNoServices ¶
type ErrNoServices struct {
ProjectName string // may be empty
}
func (ErrNoServices) Error ¶
func (e ErrNoServices) Error() string
type PrintConfig ¶
type PrintConfig struct {
Name string
}
type PrintDeployment ¶
type Sample ¶
type Sample struct { Name string `json:"name"` Title string `json:"title"` Category string `json:"category"` // Deprecated: use Languages instead Readme string `json:"readme"` // unused DirectoryName string `json:"directoryName"` ShortDescription string `json:"shortDescription"` Tags []string `json:"tags"` Languages []string `json:"languages"` Configs []string `json:"configs"` }
type ServiceStatus ¶
type ServiceStatus string
const ( ServiceUnspecified ServiceStatus = "UNSPECIFIED" // build states ServiceBuildQueued ServiceStatus = "BUILD_QUEUED" ServiceBuildProvisioning ServiceStatus = "BUILD_PROVISIONING" ServiceBuildPending ServiceStatus = "BUILD_PENDING" ServiceBuildActivating ServiceStatus = "BUILD_ACTIVATING" ServiceBuildRunning ServiceStatus = "BUILD_RUNNING" ServiceBuildDeactivating ServiceStatus = "BUILD_DEACTIVATING" // build completed // update states ServiceUpdateQueued ServiceStatus = "UPDATE_QUEUED" // queued for deployment // deplpyment states ServicePending ServiceStatus = "PENDING" ServiceCompleted ServiceStatus = "COMPLETED" ServiceFailed ServiceStatus = "FAILED" )
type ShowAccountData ¶
type TailDetectStopEventFunc
deprecated
Deprecated: use Subscribe instead #851
func CreateEndLogEventDetectFunc
deprecated
func CreateEndLogEventDetectFunc(conditionals []EndLogConditional) TailDetectStopEventFunc
Deprecated: use Subscribe instead #851
Source Files ¶
- agree_tos.go
- bootstrap.go
- cert.go
- common.go
- composeDown.go
- composeUp.go
- configDelete.go
- configList.go
- configSet.go
- connect.go
- debug.go
- delete.go
- deploymentsList.go
- generate.go
- getServices.go
- getVersion.go
- login.go
- logout.go
- new.go
- sendMsg.go
- subscribe.go
- tail.go
- teardown.go
- token.go
- upgrade.go
- whoami.go
Click to show internal directories.
Click to hide internal directories.