Documentation
¶
Index ¶
- Constants
- Variables
- func GetGoogleAPIErrorDetail(detail any, path string) string
- func GetListInStruct(s *structpb.Struct, path string) []*structpb.Value
- func GetUserEmail() (string, error)
- func GetValueInStruct(s *structpb.Struct, path string) string
- func LogEntriesToString(logEntries []*loggingpb.LogEntry) string
- func LogEntryToString(logEntry *loggingpb.LogEntry) (string, string, error)
- type ByocGcp
- func (b *ByocGcp) AccountInfo(ctx context.Context) (*client.AccountInfo, error)
- func (b *ByocGcp) CdCommand(ctx context.Context, req client.CdCommandRequest) (types.ETag, error)
- func (b *ByocGcp) CdList(ctx context.Context, _allRegions bool) (iter.Seq[string], error)
- func (b *ByocGcp) CreateUploadURL(ctx context.Context, req *defangv1.UploadURLRequest) (*defangv1.UploadURLResponse, error)
- func (b *ByocGcp) DeleteConfig(ctx context.Context, req *defangv1.Secrets) error
- func (b *ByocGcp) Deploy(ctx context.Context, req *client.DeployRequest) (*defangv1.DeployResponse, error)
- func (b *ByocGcp) GetDeploymentStatus(ctx context.Context) error
- func (*ByocGcp) GetPrivateDomain(projectName string) string
- func (b *ByocGcp) GetProjectUpdate(ctx context.Context, projectName string) (*defangv1.ProjectUpdate, error)
- func (b *ByocGcp) GetService(ctx context.Context, req *defangv1.GetRequest) (*defangv1.ServiceInfo, error)
- func (b *ByocGcp) GetServices(ctx context.Context, req *defangv1.GetServicesRequest) (*defangv1.GetServicesResponse, error)
- func (b *ByocGcp) ListConfig(ctx context.Context, req *defangv1.ListConfigsRequest) (*defangv1.Secrets, error)
- func (b *ByocGcp) PrepareDomainDelegation(ctx context.Context, req client.PrepareDomainDelegationRequest) (*client.PrepareDomainDelegationResponse, error)
- func (b *ByocGcp) Preview(ctx context.Context, req *client.DeployRequest) (*defangv1.DeployResponse, error)
- func (b *ByocGcp) PutConfig(ctx context.Context, req *defangv1.PutConfigRequest) error
- func (b *ByocGcp) QueryLogs(ctx context.Context, req *defangv1.TailRequest) (client.ServerStream[defangv1.TailResponse], error)
- func (b *ByocGcp) SetUpCD(ctx context.Context) error
- func (b *ByocGcp) Subscribe(ctx context.Context, req *defangv1.SubscribeRequest) (client.ServerStream[defangv1.SubscribeResponse], error)
- func (b *ByocGcp) TearDownCD(ctx context.Context) error
- type CloudBuildStep
- type ConflictDelegateDomainError
- type CredentialsError
- type GcpLogsClient
- type LogFilter
- type LogParser
- type LogStream
- func (s *LogStream) AddCloudBuildLog(stack, project, etag string, services []string)
- func (s *LogStream) AddFilter(filter string)
- func (s *LogStream) AddJobExecutionLog(executionName string)
- func (s *LogStream) AddJobLog(stack, project, etag string, services []string)
- func (s *LogStream) AddServiceLog(stack, project, etag string, services []string)
- func (s *LogStream) AddSince(start time.Time)
- func (s *LogStream) AddUntil(end time.Time)
- type Query
- func (q *Query) AddCloudBuildActivityQuery()
- func (q *Query) AddCloudBuildLogQuery(stack, project, etag string, services []string)
- func (q *Query) AddComputeEngineInstanceGroupAddInstances()
- func (q *Query) AddComputeEngineInstanceGroupInsertOrPatch(stack, project, etag string, services []string)
- func (q *Query) AddComputeEngineLogQuery(stack, project, etag string, services []string)
- func (q *Query) AddFilter(filter string)
- func (q *Query) AddJobExecutionQuery(executionName string)
- func (q *Query) AddJobExecutionUpdateQuery(executionName string)
- func (q *Query) AddJobLogQuery(stack, project, etag string, services []string)
- func (q *Query) AddJobStatusUpdateRequestQuery(stack, project, etag string, services []string)
- func (q *Query) AddJobStatusUpdateResponseQuery(stack, project, etag string, services []string)
- func (q *Query) AddQuery(query string)
- func (q *Query) AddServiceLogQuery(stack, project, etag string, services []string)
- func (q *Query) AddServiceStatusReponseUpdate(stack, project, etag string, services []string)
- func (q *Query) AddServiceStatusRequestUpdate(stack, project, etag string, services []string)
- func (q *Query) AddSince(since time.Time)
- func (q *Query) AddUntil(until time.Time)
- func (q *Query) GetQuery() string
- type ServerStream
- func (s *ServerStream[T]) AddCustomQuery(query string)
- func (s *ServerStream[T]) Close() error
- func (s *ServerStream[T]) Err() error
- func (s *ServerStream[T]) GetQuery() string
- func (s *ServerStream[T]) Msg() *T
- func (s *ServerStream[T]) Receive() bool
- func (s *ServerStream[T]) StartFollow(start time.Time)
- func (s *ServerStream[T]) StartHead(limit int32)
- func (s *ServerStream[T]) StartTail(limit int32)
- type SubscribeStream
Constants ¶
View Source
const ( DefangCDProjectName = "defang-cd" DefangUploadServiceAccountName = "defang-upload" UploadPrefix = "uploads/" )
Variables ¶
View Source
var (
DefaultCDTags = map[string]string{"created-by": "defang"}
)
Functions ¶
func GetGoogleAPIErrorDetail ¶
Used to get nested values from the detail of a googleapi.Error
func GetUserEmail ¶
func GetValueInStruct ¶
Extract a string value from a nested structpb.Struct
func LogEntriesToString ¶
Types ¶
type ByocGcp ¶
type ByocGcp struct {
*byoc.ByocBaseClient
// contains filtered or unexported fields
}
func NewByocProvider ¶
func (*ByocGcp) AccountInfo ¶
func (*ByocGcp) CreateUploadURL ¶
func (b *ByocGcp) CreateUploadURL(ctx context.Context, req *defangv1.UploadURLRequest) (*defangv1.UploadURLResponse, error)
func (*ByocGcp) DeleteConfig ¶
func (*ByocGcp) Deploy ¶
func (b *ByocGcp) Deploy(ctx context.Context, req *client.DeployRequest) (*defangv1.DeployResponse, error)
func (*ByocGcp) GetDeploymentStatus ¶
func (*ByocGcp) GetPrivateDomain ¶
func (*ByocGcp) GetProjectUpdate ¶
func (*ByocGcp) GetService ¶
func (b *ByocGcp) GetService(ctx context.Context, req *defangv1.GetRequest) (*defangv1.ServiceInfo, error)
func (*ByocGcp) GetServices ¶
func (b *ByocGcp) GetServices(ctx context.Context, req *defangv1.GetServicesRequest) (*defangv1.GetServicesResponse, error)
func (*ByocGcp) ListConfig ¶
func (*ByocGcp) PrepareDomainDelegation ¶
func (b *ByocGcp) PrepareDomainDelegation(ctx context.Context, req client.PrepareDomainDelegationRequest) (*client.PrepareDomainDelegationResponse, error)
func (*ByocGcp) Preview ¶
func (b *ByocGcp) Preview(ctx context.Context, req *client.DeployRequest) (*defangv1.DeployResponse, error)
func (*ByocGcp) QueryLogs ¶
func (b *ByocGcp) QueryLogs(ctx context.Context, req *defangv1.TailRequest) (client.ServerStream[defangv1.TailResponse], error)
func (*ByocGcp) Subscribe ¶
func (b *ByocGcp) Subscribe(ctx context.Context, req *defangv1.SubscribeRequest) (client.ServerStream[defangv1.SubscribeResponse], error)
type CloudBuildStep ¶
type ConflictDelegateDomainError ¶
type ConflictDelegateDomainError struct {
NewDomain string
ConflictDomain string
ConflictZone string
Err error
}
func (ConflictDelegateDomainError) Error ¶
func (e ConflictDelegateDomainError) Error() string
type CredentialsError ¶
type CredentialsError struct {
// contains filtered or unexported fields
}
func (CredentialsError) Unwrap ¶
func (e CredentialsError) Unwrap() error
type GcpLogsClient ¶
type GcpLogsClient interface {
ListLogEntries(ctx context.Context, query string, order gcp.Order) (gcp.Lister, error)
NewTailer(ctx context.Context) (gcp.Tailer, error)
GetExecutionEnv(ctx context.Context, executionName string) (map[string]string, error)
GetProjectID() gcp.ProjectId
GetBuildInfo(ctx context.Context, buildId string) (*gcp.BuildTag, error)
}
type LogStream ¶
type LogStream struct {
*ServerStream[defangv1.TailResponse]
}
func NewLogStream ¶
func (*LogStream) AddCloudBuildLog ¶
func (*LogStream) AddJobExecutionLog ¶
func (*LogStream) AddServiceLog ¶
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
func NewLogQuery ¶
func NewSubscribeQuery ¶
func NewSubscribeQuery() *Query
func (*Query) AddCloudBuildActivityQuery ¶
func (q *Query) AddCloudBuildActivityQuery()
func (*Query) AddCloudBuildLogQuery ¶
func (*Query) AddComputeEngineInstanceGroupAddInstances ¶
func (q *Query) AddComputeEngineInstanceGroupAddInstances()
func (*Query) AddComputeEngineInstanceGroupInsertOrPatch ¶
func (*Query) AddComputeEngineLogQuery ¶
func (*Query) AddJobExecutionQuery ¶
func (*Query) AddJobExecutionUpdateQuery ¶
func (*Query) AddJobLogQuery ¶
func (*Query) AddJobStatusUpdateRequestQuery ¶
func (*Query) AddJobStatusUpdateResponseQuery ¶
func (*Query) AddServiceLogQuery ¶
func (*Query) AddServiceStatusReponseUpdate ¶
func (*Query) AddServiceStatusRequestUpdate ¶
type ServerStream ¶
type ServerStream[T any] struct { // contains filtered or unexported fields }
func NewServerStream ¶
func NewServerStream[T any](ctx context.Context, gcpLogsClient GcpLogsClient, parse LogParser[T], filters ...LogFilter[*T]) (*ServerStream[T], error)
func (*ServerStream[T]) AddCustomQuery ¶
func (s *ServerStream[T]) AddCustomQuery(query string)
func (*ServerStream[T]) Close ¶
func (s *ServerStream[T]) Close() error
func (*ServerStream[T]) Err ¶
func (s *ServerStream[T]) Err() error
func (*ServerStream[T]) GetQuery ¶
func (s *ServerStream[T]) GetQuery() string
func (*ServerStream[T]) Msg ¶
func (s *ServerStream[T]) Msg() *T
func (*ServerStream[T]) Receive ¶
func (s *ServerStream[T]) Receive() bool
func (*ServerStream[T]) StartFollow ¶
func (s *ServerStream[T]) StartFollow(start time.Time)
func (*ServerStream[T]) StartHead ¶
func (s *ServerStream[T]) StartHead(limit int32)
func (*ServerStream[T]) StartTail ¶
func (s *ServerStream[T]) StartTail(limit int32)
type SubscribeStream ¶
type SubscribeStream struct {
*ServerStream[defangv1.SubscribeResponse]
}
func NewSubscribeStream ¶
func NewSubscribeStream(ctx context.Context, driver GcpLogsClient, waitForCD bool, etag string, services []string, filters ...LogFilter[*defangv1.SubscribeResponse]) (*SubscribeStream, error)
func (*SubscribeStream) AddJobExecutionUpdate ¶
func (s *SubscribeStream) AddJobExecutionUpdate(executionName string)
func (*SubscribeStream) AddJobStatusUpdate ¶
func (s *SubscribeStream) AddJobStatusUpdate(stack, project, etag string, services []string)
func (*SubscribeStream) AddServiceStatusUpdate ¶
func (s *SubscribeStream) AddServiceStatusUpdate(stack, project, etag string, services []string)
Click to show internal directories.
Click to hide internal directories.