gcp

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultScope = cloudresourcemanager.CloudPlatformScope

DefaultScope is the default scope to use for a GCP client

Variables

This section is empty.

Functions

func GetGoogleClient

func GetGoogleClient(clientset kubernetes.Interface, namespace string, secretKey v1.SecretKeySelector,
	scopes ...string) (*http.Client, error)

GetGoogleClient returns a client object that can be used to interact with the Google API

func Int64Value

func Int64Value(v *int64) int64

Int64Value converts the supplied int64 pointer to an int, returning zero if the pointer is nil.

func IsErrorAlreadyExists

func IsErrorAlreadyExists(err error) bool

IsErrorAlreadyExists gets a value indicating whether the given error represents a "conflict" response from the Google API

func IsErrorBadRequest

func IsErrorBadRequest(err error) bool

IsErrorBadRequest gets a value indicating whether the given error represents a "bad request" response from the Google API

func IsErrorNotFound

func IsErrorNotFound(err error) bool

IsErrorNotFound gets a value indicating whether the given error represents a "not found" response from the Google API

func LateInitializeInt64

func LateInitializeInt64(i *int64, from int64) *int64

LateInitializeInt64 initializes i, presumed to be an optional field of a Kubernetes API object's spec per Kubernetes "late initialization" semantics. i is returned unchanged if it is non-nil or from is 0, otherwise a pointer to from is returned. https://github.com/kubernetes/community/blob/db7f270f/contributors/devel/sig-architecture/api-conventions.md#optional-vs-required https://github.com/kubernetes/community/blob/db7f270f/contributors/devel/sig-architecture/api-conventions.md#late-initialization

func LateInitializeString

func LateInitializeString(s *string, from string) *string

LateInitializeString initializes s, presumed to be an optional field of a Kubernetes API object's spec per Kubernetes "late initialization" semantics. s is returned unchanged if it is non-nil or from is the empty string, otherwise a pointer to from is returned. https://github.com/kubernetes/community/blob/db7f270f/contributors/devel/sig-architecture/api-conventions.md#optional-vs-required https://github.com/kubernetes/community/blob/db7f270f/contributors/devel/sig-architecture/api-conventions.md#late-initialization

func StringValue

func StringValue(v *string) string

StringValue converts the supplied string pointer to a string, returning the empty string if the pointer is nil.

func TestPermissions

func TestPermissions(creds *google.Credentials, permissions []string) error

TestPermissions tests service account permission using provided credentials and assert that it has all the provided permissions. - return nil - if all permissions are found - return an error - if one or more expected permissions are not found

Types

type ProjectInfo

type ProjectInfo struct {
	// Name: The user-assigned display name of the Project.
	Name string
	// ID: The unique, user-assigned ID of the Project.
	ID string
	// Number: The number uniquely identifying the project.
	Number int64
	// CreateTime: Project Creation time.
	CreateTime string
	// Labels: The labels associated with this Project.
	Labels map[string]string
}

ProjectInfo represent GCP Project information

func Project

func Project(creds *google.Credentials) (*ProjectInfo, error)

Project returns project information

Jump to

Keyboard shortcuts

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