gcp

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadObject

func DownloadObject(ctx context.Context, bucketName string, path string, fileName string) string

func FecthZones

func FecthZones(ctx context.Context) ([]string, error)

func GetDisk

func GetDisk(ctx context.Context, diskId string) (*compute.Disk, error)

func GetImage

func GetImage(ctx context.Context, ImageId string) (*compute.Image, error)

func GetInstance

func GetInstance(ctx context.Context, instaceId string) (*computepb.Instance, error)

func GetLocalTime

func GetLocalTime(timestamp string) (string, error)

func GetPreSignedUrl

func GetPreSignedUrl(ctx context.Context, bucketName string, path string, fileName string) string

func GetResourceFromURL

func GetResourceFromURL(url string) string

func GetSnapshot

func GetSnapshot(ctx context.Context, snapshotID string) (*compute.Snapshot, error)

Types

type DiskResp

type DiskResp struct {
	Name, Type, Size, CreationTime, Status string
	Zone                                   string
}

func ListDisks

func ListDisks(ctx context.Context) ([]DiskResp, error)

type ImageResp

type ImageResp struct {
	Name, Location, CreatedAt, Status string
}

func ListImages

func ListImages(ctx context.Context) ([]ImageResp, error)

type ServiceAccount

type ServiceAccount struct {
	ProjectID string `json:"project_id"`
}

func FetchProjectID

func FetchProjectID(filePath string) (ServiceAccount, error)

type SnapshotResp

type SnapshotResp struct {
	Name, Size, CreatedAt string
}

func ListSnapshots

func ListSnapshots(ctx context.Context) ([]SnapshotResp, error)

type StorageObjResp

type StorageObjResp struct {
	SizeInBytes                                        int64
	Name, ObjectType, LastModified, Size, StorageClass string
}

func GetInfoAboutBucket

func GetInfoAboutBucket(ctx context.Context) ([]StorageObjResp, error)

type StorageResp

type StorageResp struct {
	BucketName   string
	CreationTime string
	Region       string
}

func ListBuckets

func ListBuckets(ctx context.Context) ([]StorageResp, error)

type VMResp

type VMResp struct {
	// Instance         .Instance
	InstanceId       string
	InstanceType     string
	AvailabilityZone string
	InstanceState    string
	PublicDNS        string
	MonitoringState  string
	LaunchTime       string
}

func ListInstances

func ListInstances(ctx context.Context) ([]VMResp, error)

Jump to

Keyboard shortcuts

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