gcp

package
v0.0.0-...-dffa2cd Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2025 License: MIT Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefangCDProjectName = "defang-cd"
	UploadPrefix        = "uploads/"
)

Variables

View Source
var (
	DefaultCDTags = map[string]string{"created-by": "defang"}
)

Functions

func GetGoogleAPIErrorDetail

func GetGoogleAPIErrorDetail(detail any, path string) string

Used to get nested values from the detail of a googleapi.Error

func GetListInStruct

func GetListInStruct(s *structpb.Struct, path string) []*structpb.Value

func GetUserEmail

func GetUserEmail() (string, error)

func GetValueInStruct

func GetValueInStruct(s *structpb.Struct, path string) string

Extract a string value from a nested structpb.Struct

func LogEntriesToString

func LogEntriesToString(logEntries []*loggingpb.LogEntry) string

func LogEntryToString

func LogEntryToString(logEntry *loggingpb.LogEntry) (string, string, error)

Types

type ByocGcp

type ByocGcp struct {
	*byoc.ByocBaseClient
	// contains filtered or unexported fields
}

func NewByocProvider

func NewByocProvider(ctx context.Context, tenantName types.TenantName) *ByocGcp

func (*ByocGcp) AccountInfo

func (b *ByocGcp) AccountInfo(ctx context.Context) (*client.AccountInfo, error)

func (*ByocGcp) BootstrapCommand

func (b *ByocGcp) BootstrapCommand(ctx context.Context, req client.BootstrapCommandRequest) (types.ETag, error)

func (*ByocGcp) BootstrapList

func (b *ByocGcp) BootstrapList(ctx context.Context) ([]string, error)

func (*ByocGcp) CreateUploadURL

func (b *ByocGcp) CreateUploadURL(ctx context.Context, req *defangv1.UploadURLRequest) (*defangv1.UploadURLResponse, error)

func (*ByocGcp) Delete

func (*ByocGcp) DeleteConfig

func (b *ByocGcp) DeleteConfig(ctx context.Context, req *defangv1.Secrets) error

func (*ByocGcp) Deploy

func (*ByocGcp) Destroy

func (b *ByocGcp) Destroy(ctx context.Context, req *defangv1.DestroyRequest) (types.ETag, error)

func (*ByocGcp) GetDeploymentStatus

func (b *ByocGcp) GetDeploymentStatus(ctx context.Context) error

func (*ByocGcp) GetProjectUpdate

func (b *ByocGcp) GetProjectUpdate(ctx context.Context, projectName string) (*defangv1.ProjectUpdate, error)

func (*ByocGcp) GetService

func (b *ByocGcp) GetService(ctx context.Context, req *defangv1.GetRequest) (*defangv1.ServiceInfo, error)

func (*ByocGcp) GetServices

func (*ByocGcp) GetStackName

func (b *ByocGcp) GetStackName() string

func (*ByocGcp) ListConfig

func (b *ByocGcp) ListConfig(ctx context.Context, req *defangv1.ListConfigsRequest) (*defangv1.Secrets, error)

func (*ByocGcp) Preview

func (*ByocGcp) PutConfig

func (b *ByocGcp) PutConfig(ctx context.Context, req *defangv1.PutConfigRequest) error

func (*ByocGcp) QueryForDebug

func (b *ByocGcp) QueryForDebug(ctx context.Context, req *defangv1.DebugRequest) error

func (*ByocGcp) QueryLogs

func (*ByocGcp) StackName

func (b *ByocGcp) StackName(projectName, name string) string

func (*ByocGcp) TearDown

func (b *ByocGcp) TearDown(ctx context.Context) error

type ConflictDelegateDomainError

type ConflictDelegateDomainError struct {
	NewDomain      string
	ConflictDomain string
	ConflictZone   string
	Err            error
}

func (ConflictDelegateDomainError) Error

type CredentialsError

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

func (CredentialsError) Unwrap

func (e CredentialsError) Unwrap() error

type LogFilter

type LogFilter[T any] func(entry T) T

type LogParser

type LogParser[T any] func(*loggingpb.LogEntry) ([]*T, error)

type LogStream

type LogStream struct {
	*ServerStream[defangv1.TailResponse]
}

func NewLogStream

func NewLogStream(ctx context.Context, gcpClient *gcp.Gcp, services []string) (*LogStream, error)

func (*LogStream) AddCloudBuildLog

func (s *LogStream) AddCloudBuildLog(stack, project, etag string, services []string)

func (*LogStream) AddFilter

func (s *LogStream) AddFilter(filter string)

func (*LogStream) AddJobExecutionLog

func (s *LogStream) AddJobExecutionLog(executionName string)

func (*LogStream) AddJobLog

func (s *LogStream) AddJobLog(stack, project, etag string, services []string)

func (*LogStream) AddServiceLog

func (s *LogStream) AddServiceLog(stack, project, etag string, services []string)

func (*LogStream) AddSince

func (s *LogStream) AddSince(start time.Time)

func (*LogStream) AddUntil

func (s *LogStream) AddUntil(end time.Time)

type Query

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

func NewLogQuery

func NewLogQuery(projectId string) *Query

func NewQuery

func NewQuery(baseQuery string) *Query

func NewSubscribeQuery

func NewSubscribeQuery() *Query

func (*Query) AddCloudBuildActivityQuery

func (q *Query) AddCloudBuildActivityQuery()

func (*Query) AddCloudBuildLogQuery

func (q *Query) AddCloudBuildLogQuery(stack, project, etag string, services []string)

func (*Query) AddComputeEngineInstanceGroupAddInstances

func (q *Query) AddComputeEngineInstanceGroupAddInstances()

func (*Query) AddComputeEngineInstanceGroupInsertOrPatch

func (q *Query) AddComputeEngineInstanceGroupInsertOrPatch(stack, project, etag string, services []string)

func (*Query) AddComputeEngineLogQuery

func (q *Query) AddComputeEngineLogQuery(stack, project, etag string, services []string)

func (*Query) AddFilter

func (q *Query) AddFilter(filter string)

func (*Query) AddJobExecutionQuery

func (q *Query) AddJobExecutionQuery(executionName string)

func (*Query) AddJobExecutionUpdateQuery

func (q *Query) AddJobExecutionUpdateQuery(executionName string)

func (*Query) AddJobLogQuery

func (q *Query) AddJobLogQuery(stack, project, etag string, services []string)

func (*Query) AddJobStatusUpdateRequestQuery

func (q *Query) AddJobStatusUpdateRequestQuery(stack, project, etag string, services []string)

func (*Query) AddJobStatusUpdateResponseQuery

func (q *Query) AddJobStatusUpdateResponseQuery(stack, project, etag string, services []string)

func (*Query) AddQuery

func (q *Query) AddQuery(query string)

func (*Query) AddServiceLogQuery

func (q *Query) AddServiceLogQuery(stack, project, etag string, services []string)

func (*Query) AddServiceStatusReponseUpdate

func (q *Query) AddServiceStatusReponseUpdate(stack, project, etag string, services []string)

func (*Query) AddServiceStatusRequestUpdate

func (q *Query) AddServiceStatusRequestUpdate(stack, project, etag string, services []string)

func (*Query) AddSince

func (q *Query) AddSince(since time.Time)

func (*Query) AddUntil

func (q *Query) AddUntil(until time.Time)

func (*Query) GetQuery

func (q *Query) GetQuery() string

type ServerStream

type ServerStream[T any] struct {
	// contains filtered or unexported fields
}

func NewServerStream

func NewServerStream[T any](ctx context.Context, gcp *gcp.Gcp, 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]) Start

func (s *ServerStream[T]) Start(start time.Time)

type SubscribeStream

type SubscribeStream struct {
	*ServerStream[defangv1.SubscribeResponse]
}

func NewSubscribeStream

func NewSubscribeStream(ctx context.Context, driver *gcp.Gcp, 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)

Jump to

Keyboard shortcuts

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