gcp

package
v0.0.0-...-c60b83b Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: MIT Imports: 32 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"}
	PulumiVersion = pkg.Getenv("DEFANG_PULUMI_VERSION", "3.136.1")
)

Functions

func GetGoogleAPIErrorDetail

func GetGoogleAPIErrorDetail(detail interface{}, path string) string

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

func GetValueInStruct

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

Extract a string value from a nested structpb.Struct

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) Follow

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) 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) Query

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

func (*ByocGcp) TearDown

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

type GcpAccountInfo

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

func (GcpAccountInfo) AccountID

func (g GcpAccountInfo) AccountID() string

func (GcpAccountInfo) Details

func (g GcpAccountInfo) Details() string

func (GcpAccountInfo) Provider

func (g GcpAccountInfo) Provider() client.ProviderID

func (GcpAccountInfo) Region

func (g GcpAccountInfo) Region() string

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, gcp *gcp.Gcp) (*LogStream, error)

func (*LogStream) AddJobExecutionLog

func (s *LogStream) AddJobExecutionLog(executionName string, since time.Time)

func (*LogStream) AddJobLog

func (s *LogStream) AddJobLog(project, etag string, services []string, since time.Time)

func (*LogStream) AddServiceLog

func (s *LogStream) AddServiceLog(project, etag string, services []string, since time.Time)

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]) (*ServerStream[T], error)

func (*ServerStream[T]) Close

func (s *ServerStream[T]) Close() error

func (*ServerStream[T]) Err

func (s *ServerStream[T]) Err() error

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() error

type SubscribeStream

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

func NewSubscribeStream

func NewSubscribeStream(ctx context.Context, gcp *gcp.Gcp) (*SubscribeStream, error)

func (*SubscribeStream) AddJobExecutionUpdate

func (s *SubscribeStream) AddJobExecutionUpdate(executionName string)

func (*SubscribeStream) AddJobStatusUpdate

func (s *SubscribeStream) AddJobStatusUpdate(project, etag string, services []string)

func (*SubscribeStream) AddServiceStatusUpdate

func (s *SubscribeStream) AddServiceStatusUpdate(project, etag string, services []string)

Jump to

Keyboard shortcuts

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