Documentation
¶
Index ¶
- Constants
- Variables
- func CanMonitorService(service *compose.ServiceConfig) bool
- func CdCommand(ctx context.Context, projectName string, provider client.Provider, ...) (types.ETag, error)
- func CdCommandAndTail(ctx context.Context, provider client.Provider, projectName string, ...) error
- func CdListLocal(ctx context.Context, provider client.Provider, allRegions bool) error
- func ComposeDown(ctx context.Context, projectName string, fabric client.FabricClient, ...) (types.ETag, error)
- func ComposeUp(ctx context.Context, fabric client.FabricClient, provider client.Provider, ...) (*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 Connect(cluster string, requestedTenant types.TenantNameOrID) *client.GrpcClient
- func ConnectWithTenant(ctx context.Context, addr string, requestedTenant types.TenantNameOrID) (*client.GrpcClient, error)
- func CreateRandomConfigValue() string
- func DeploymentsList(ctx context.Context, client client.FabricClient, params ListDeploymentsParams) error
- func EnableUTCMode()
- func GenerateLetsEncryptCert(ctx context.Context, project *compose.Project, client client.FabricClient, ...) error
- func GeneratePreview(ctx context.Context, project *compose.Project, client client.FabricClient, ...) (string, error)
- func GenerateWithAI(ctx context.Context, client client.FabricClient, args GenerateArgs) ([]string, error)
- func GetServices(ctx context.Context, projectName string, provider client.Provider) (*defangv1.GetServicesResponse, error)
- func GetStatesAndEventsUploadUrls(ctx context.Context, projectName string, provider client.Provider, ...) (statesUrl string, eventsUrl string, err error)
- func GetVersion(ctx context.Context, client client.FabricClient) (string, error)
- func InitFromSamples(ctx context.Context, dir string, names []string) error
- func InstallCD(ctx context.Context, provider client.Provider) error
- func InteractiveComposeDown(ctx context.Context, projectName string, fabric client.FabricClient, ...) (types.ETag, error)
- 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 NewProvider(ctx context.Context, providerID client.ProviderID, ...) client.Provider
- func Preview(ctx context.Context, project *compose.Project, fabric client.FabricClient, ...) error
- func PrintConfigSummaryAndValidate(ctx context.Context, provider client.Provider, project *compose.Project) error
- func PrintEstimate(mode modes.Mode, estimate *defangv1.EstimateResponse, term *term.Term)
- func PrintObject(root string, data proto.Message) error
- func PrintServiceStatesAndEndpoints(serviceInfos []*defangv1.ServiceInfo) error
- func PrintServices(ctx context.Context, projectName string, provider client.Provider, long bool) error
- func ResolveWorkspaceID(info *auth.UserInfo, tenantSelection types.TenantNameOrID) string
- func ResolveWorkspaceName(info *auth.UserInfo, tenantSelection types.TenantNameOrID) string
- func RunEstimate(ctx context.Context, project *compose.Project, client client.FabricClient, ...) (*defangv1.EstimateResponse, error)
- func SendMsg(ctx context.Context, client client.FabricClient, subject, _type, id string, ...) error
- func SplitProjectStack(name string) (projectName string, stackName string)
- func Tail(ctx context.Context, provider client.Provider, projectName string, ...) error
- func TailAndWaitForCD(ctx context.Context, provider client.Provider, projectName string, ...) error
- func TearDownCD(ctx context.Context, provider client.Provider, force bool) error
- func Token(ctx context.Context, client client.FabricClient, tenant types.TenantNameOrID, ...) error
- func UpdateServiceStates(ctx context.Context, serviceInfos []*defangv1.ServiceInfo)
- func Upgrade(ctx context.Context) error
- func WaitForCdTaskExit(ctx context.Context, provider client.Provider) error
- type CancelError
- type ComposeError
- type ComposeUpParams
- type DNSResult
- type ErrNoServices
- type EstimateLineItemTableItem
- type GenerateArgs
- type HTTPClient
- type ListDeploymentsParams
- type LogEntryHandler
- type PrintConfig
- type PrintDeployment
- type Sample
- type Service
- type ServiceStates
- type ShowAccountData
- type Source
- type TailDetectStopEventFuncdeprecated
- type TailOptions
- type WorkspaceRow
Constants ¶
const (
RFC3339Milli = "2006-01-02T15:04:05.000Z07:00" // like RFC3339Nano but with 3 digits of precision
)
Variables ¶
var ErrDoNotComposeDown = errors.New("user did not want to compose down")
var ErrNothingToMonitor = errors.New("no services to monitor")
var ErrSampleNotFound = errors.New("sample not found")
var P = track.P
var SupportedLanguages = []string{"Nodejs", "Golang", "Python"}
Functions ¶
func CanMonitorService ¶
func CanMonitorService(service *compose.ServiceConfig) bool
func CdCommandAndTail ¶
func CdListLocal ¶
func ComposeDown ¶
func ComposeUp ¶
func ComposeUp(ctx context.Context, fabric client.FabricClient, provider client.Provider, params ComposeUpParams) (*defangv1.DeployResponse, *compose.Project, error)
ComposeUp validates a compose project and uploads the services using the client
func ConfigDelete ¶
func ConfigList ¶
func Connect ¶
func Connect(cluster string, requestedTenant types.TenantNameOrID) *client.GrpcClient
Connect builds a client carrying the requested tenant (name or ID).
func ConnectWithTenant ¶
func ConnectWithTenant(ctx context.Context, addr string, requestedTenant types.TenantNameOrID) (*client.GrpcClient, error)
func CreateRandomConfigValue ¶
func CreateRandomConfigValue() string
func DeploymentsList ¶
func DeploymentsList(ctx context.Context, client client.FabricClient, params ListDeploymentsParams) error
func GenerateLetsEncryptCert ¶
func GeneratePreview ¶
func GenerateWithAI ¶
func GenerateWithAI(ctx context.Context, client client.FabricClient, args GenerateArgs) ([]string, error)
func GetServices ¶
func GetVersion ¶
func InitFromSamples ¶
InitFromSamples copies the sample(s) into the given directory, aborting if any files already exist.
func InteractiveComposeDown ¶
func MixinFromSample ¶
MixinFromSamples copies the sample files into the given directory, skipping existing files.
func NewProvider ¶
func NewProvider(ctx context.Context, providerID client.ProviderID, fabricClient client.FabricClient, stack string) client.Provider
func Preview ¶
func Preview(ctx context.Context, project *compose.Project, fabric client.FabricClient, provider client.Provider, params ComposeUpParams) error
func PrintEstimate ¶
func PrintServiceStatesAndEndpoints ¶
func PrintServiceStatesAndEndpoints(serviceInfos []*defangv1.ServiceInfo) error
func PrintServices ¶
func ResolveWorkspaceID ¶
func ResolveWorkspaceID(info *auth.UserInfo, tenantSelection types.TenantNameOrID) string
ResolveWorkspaceID returns the workspace ID matching the provided selection (flag/env/token subject). If no match is found, returns an empty string.
func ResolveWorkspaceName ¶
func ResolveWorkspaceName(info *auth.UserInfo, tenantSelection types.TenantNameOrID) string
ResolveWorkspaceName maps the selected tenant (flag/env/token subject) to a known workspace name when available. If no selection is set, returns an empty string.
func RunEstimate ¶
func SplitProjectStack ¶
func TailAndWaitForCD ¶
func UpdateServiceStates ¶
func UpdateServiceStates(ctx context.Context, serviceInfos []*defangv1.ServiceInfo)
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 ComposeUpParams ¶
type ErrNoServices ¶
type ErrNoServices struct {
ProjectName string // may be empty
}
func (ErrNoServices) Error ¶
func (e ErrNoServices) Error() string
type GenerateArgs ¶
type ListDeploymentsParams ¶
type ListDeploymentsParams struct {
ListType defangv1.DeploymentType
ProjectName string
StackName string
Limit uint32
}
type LogEntryHandler ¶
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 Service ¶
type Service struct {
Deployment string
Endpoint string
Service string
State defangv1.ServiceState
Status string
Fqdn string
}
func GetServiceStatesAndEndpoints ¶
func GetServiceStatesAndEndpoints(serviceInfos []*defangv1.ServiceInfo) ([]*Service, bool, error)
type ServiceStates ¶
type ServiceStates = map[string]defangv1.ServiceState
func TailAndMonitor ¶
func WaitServiceState ¶
type ShowAccountData ¶
type ShowAccountData struct {
Provider client.ProviderID `json:"provider"`
SubscriberTier defangv1.SubscriptionTier `json:"subscriberTier"`
Region string `json:"region"`
Workspace string `json:"workspace"`
Tenant string `json:"tenant,omitempty"` // this is the subdomain
TenantID string `json:"tenantId,omitempty"`
Email string `json:"email"`
Name string `json:"name"`
}
func Whoami ¶
func Whoami(ctx context.Context, fabric client.FabricClient, provider client.Provider, userInfo *auth.UserInfo, tenantSelection types.TenantNameOrID) (ShowAccountData, error)
type TailDetectStopEventFunc
deprecated
type TailOptions ¶
type TailOptions struct {
Deployment types.ETag
EndEventDetectFunc TailDetectStopEventFunc // Deprecated: use Subscribe and GetDeploymentStatus instead #851
Filter string
Follow bool
Limit int32
LogType logs.LogType
Raw bool
Services []string
Since time.Time
Until time.Time
Verbose bool
PrintBookends bool
}
func (TailOptions) String ¶
func (to TailOptions) String() string
type WorkspaceRow ¶
type WorkspaceRow struct {
Name string `json:"name"`
ID string `json:"id,omitempty"`
Current bool `json:"current"`
}
func WorkspaceRows ¶
func WorkspaceRows(info *auth.UserInfo, tenantSelection types.TenantNameOrID) []WorkspaceRow
WorkspaceRows marks the current workspace using the provided tenant selection.
Source Files
¶
- cd.go
- cert.go
- common.go
- composeDown.go
- composeUp.go
- configDelete.go
- configList.go
- configResolution.go
- configSet.go
- configrandom.go
- connect.go
- deploymentinfo.go
- deploymentsList.go
- estimate.go
- generate.go
- getServices.go
- getVersion.go
- install_cd.go
- logout.go
- new.go
- preview.go
- sendMsg.go
- subscribe.go
- tail.go
- tailAndMonitor.go
- teardown_cd.go
- token.go
- upgrade.go
- waitForCdTaskExit.go
- whoami.go
- workspace.go