Documentation
¶
Index ¶
- Constants
- func ConvertGCSObjectsToKeys(gcsObjects ...*storage.ObjectAttrs) []string
- func ErrorCredentialsFileEnvVarNotSet() error
- func ErrorInvalidGCSPath(provided string) error
- func ErrorProjectIDMismatch(credsFileProject string, providedProject string, credsFilePath string) error
- func GCSPath(bucket string, key string) string
- func IsBucketAlreadyExistsError(err error) bool
- func IsBucketDoesNotExist(err error) bool
- func IsErrCode(err error, errorCode int, errorMessage *string) bool
- func IsGCPError(err error) bool
- func IsInvalidBucketNameError(err error) bool
- func IsValidGCSPath(gcsPath string) bool
- func NewGoogleAuthProvider(addr string, config map[string]string, ...) (rest.AuthProvider, error)
- func SplitGCSPath(gcsPath string) (string, string, error)
- func ZoneToRegion(zone string) string
- type Client
- func (c *Client) ClusterExists(clusterName string) (bool, error)
- func (c *Client) Compute() (*compute.Service, error)
- func (c *Client) CreateBucket(bucket string, location string, ignoreErrorIfBucketExists bool) error
- func (c *Client) CreateCluster(req *containerpb.CreateClusterRequest) (*containerpb.Operation, error)
- func (c *Client) CreateK8SConfigFromCluster(cluster *containerpb.Cluster) (*rest.Config, error)
- func (c *Client) DeleteBucket(bucket string) error
- func (c *Client) DeleteCluster(clusterName string) (*containerpb.Operation, error)
- func (c *Client) DeleteGCSDir(bucket string, gcsDir string, continueIfFailure bool) error
- func (c *Client) DeleteGCSFile(bucket string, key string) error
- func (c *Client) DeleteGCSPrefix(bucket string, gcsDir string, continueIfFailure bool) error
- func (c *Client) DoesBucketExist(bucket string) (bool, error)
- func (c *Client) GCS() (*storage.Client, error)
- func (c *Client) GKE() (*container.ClusterManagerClient, error)
- func (c *Client) GetAvailableAcceleratorTypes(zone string) ([]string, error)
- func (c *Client) GetAvailableAcceleratorTypesForAllZones() ([]string, error)
- func (c *Client) GetAvailableInstanceTypes(zone string) ([]string, error)
- func (c *Client) GetAvailableInstanceTypesForAllZones() ([]string, error)
- func (c *Client) GetAvailableZones() ([]string, error)
- func (c *Client) GetAvailableZonesForAccelerator(acceleratorType string) ([]string, error)
- func (c *Client) GetCluster(clusterName string) (*containerpb.Cluster, error)
- func (c *Client) GetInstanceTypesMetadata(zone string) ([]compute.MachineType, error)
- func (c *Client) GetInstanceTypesMetadataForAllZones() ([]compute.MachineType, error)
- func (c *Client) GetInstanceTypesWithPrefix(prefix string, zone string) ([]string, error)
- func (c *Client) IsAcceleratorTypeAvailable(acceleratorType string, zone string) (bool, error)
- func (c *Client) IsGCSFile(bucket string, key string) (bool, error)
- func (c *Client) IsInstanceTypeAvailable(instanceType string, zone string) (bool, error)
- func (c *Client) IsProjectIDValid() (bool, error)
- func (c *Client) IsZoneValid(zone string) (bool, error)
- func (c *Client) ListGCSDir(bucket string, gcsDir string, includeDirObjects bool, maxResults *int64) ([]*storage.ObjectAttrs, error)
- func (c *Client) ListGCSDirOneLevel(bucket string, gcsDir string, maxResults *int64) ([]string, error)
- func (c *Client) ListGCSPathDir(gcsDirPath string, includeDirObjects bool, maxResults *int64) ([]*storage.ObjectAttrs, error)
- func (c *Client) ListGCSPrefix(bucket string, prefix string, includeDirObjects bool, maxResults *int64) ([]*storage.ObjectAttrs, error)
- func (c *Client) ReadBytesFromGCS(bucket string, key string) ([]byte, error)
- func (c *Client) ReadJSONFromGCS(objPtr interface{}, bucket string, key string) error
- func (c *Client) UploadBytesToGCS(data []byte, bucket string, key string) error
- func (c *Client) UploadJSONToGCS(obj interface{}, bucket string, key string) error
- func (c *Client) UploadStringToGCS(str string, bucket string, key string) error
Constants ¶
View Source
const ( ErrInvalidGCSPath = "gcp.invalid_gcs_path" ErrCredentialsFileEnvVarNotSet = "gcp.credentials_file_env_var_not_set" ErrProjectIDMismatch = "gcp.project_id_mismatch" )
Variables ¶
This section is empty.
Functions ¶
func ConvertGCSObjectsToKeys ¶ added in v0.27.0
func ConvertGCSObjectsToKeys(gcsObjects ...*storage.ObjectAttrs) []string
func ErrorCredentialsFileEnvVarNotSet ¶
func ErrorCredentialsFileEnvVarNotSet() error
func ErrorInvalidGCSPath ¶
func ErrorProjectIDMismatch ¶
func IsBucketDoesNotExist ¶ added in v0.28.0
func IsGCPError ¶
func IsValidGCSPath ¶
func NewGoogleAuthProvider ¶
func NewGoogleAuthProvider(addr string, config map[string]string, persister rest.AuthProviderConfigPersister) (rest.AuthProvider, error)
func ZoneToRegion ¶
Types ¶
type Client ¶
type Client struct { ProjectID string HashedProjectID string ClientEmail string ClientID string PrivateKey string PrivateKeyID string IsAnonymous bool CredentialsJSON []byte // contains filtered or unexported fields }
func NewAnonymousClient ¶ added in v0.25.0
func NewAnonymousClient() *Client
func NewFromEnv ¶
Uses environment variable $GOOGLE_APPLICATION_CREDENTIALS
func NewFromEnvCheckProjectID ¶
Uses environment variable $GOOGLE_APPLICATION_CREDENTIALS
func (*Client) ClusterExists ¶ added in v0.25.0
func (*Client) CreateBucket ¶
func (*Client) CreateCluster ¶
func (c *Client) CreateCluster(req *containerpb.CreateClusterRequest) (*containerpb.Operation, error)
func (*Client) CreateK8SConfigFromCluster ¶
func (*Client) DeleteBucket ¶
func (*Client) DeleteCluster ¶
func (c *Client) DeleteCluster(clusterName string) (*containerpb.Operation, error)
func (*Client) DeleteGCSDir ¶
func (*Client) DeleteGCSPrefix ¶
func (*Client) DoesBucketExist ¶ added in v0.28.0
func (*Client) GetAvailableAcceleratorTypes ¶
func (*Client) GetAvailableAcceleratorTypesForAllZones ¶
func (*Client) GetAvailableInstanceTypes ¶
func (*Client) GetAvailableInstanceTypesForAllZones ¶
func (*Client) GetAvailableZones ¶
func (*Client) GetAvailableZonesForAccelerator ¶
func (*Client) GetCluster ¶
func (c *Client) GetCluster(clusterName string) (*containerpb.Cluster, error)
func (*Client) GetInstanceTypesMetadata ¶
func (*Client) GetInstanceTypesMetadataForAllZones ¶
func (*Client) GetInstanceTypesWithPrefix ¶
func (*Client) IsAcceleratorTypeAvailable ¶
func (*Client) IsInstanceTypeAvailable ¶
func (*Client) IsProjectIDValid ¶
func (*Client) ListGCSDir ¶
func (*Client) ListGCSDirOneLevel ¶
func (c *Client) ListGCSDirOneLevel(bucket string, gcsDir string, maxResults *int64) ([]string, error)
This behaves like you'd expect `ls` to behave on a local file system "directory" names will be returned even if S3 directory objects don't exist
func (*Client) ListGCSPathDir ¶
func (*Client) ListGCSPrefix ¶ added in v0.27.0
func (*Client) ReadBytesFromGCS ¶
func (*Client) ReadJSONFromGCS ¶
func (*Client) UploadBytesToGCS ¶
func (*Client) UploadJSONToGCS ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.