gcp

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	//IAM
	CreateServiceAccount(context.Context, *iamadminpb.CreateServiceAccountRequest) (*iamadminpb.ServiceAccount, error)
	CreateServiceAccountKey(context.Context, *iamadminpb.CreateServiceAccountKeyRequest) (*iamadminpb.ServiceAccountKey, error)
	DeleteServiceAccount(context.Context, *iamadminpb.DeleteServiceAccountRequest) error
	DeleteServiceAccountKey(context.Context, *iamadminpb.DeleteServiceAccountKeyRequest) error
	GetRole(context.Context, *iamadminpb.GetRoleRequest) (*iamadminpb.Role, error)
	CreateRole(context.Context, *iamadminpb.CreateRoleRequest) (*iamadminpb.Role, error)
	UpdateRole(context.Context, *iamadminpb.UpdateRoleRequest) (*iamadminpb.Role, error)
	DeleteRole(context.Context, *iamadminpb.DeleteRoleRequest) (*iamadminpb.Role, error)
	ListRoles(context.Context, *iamadminpb.ListRolesRequest) (*iamadminpb.ListRolesResponse, error)
	GetServiceAccount(context.Context, *iamadminpb.GetServiceAccountRequest) (*iamadminpb.ServiceAccount, error)
	ListServiceAccountKeys(context.Context, *iamadminpb.ListServiceAccountKeysRequest) (*iamadminpb.ListServiceAccountKeysResponse, error)
	ListServiceAccounts(context.Context, *iamadminpb.ListServiceAccountsRequest) ([]*iamadminpb.ServiceAccount, error)
	QueryTestablePermissions(context.Context, *iamadminpb.QueryTestablePermissionsRequest) (*iamadminpb.QueryTestablePermissionsResponse, error)
	CreateWorkloadIdentityPool(context.Context, string, string, *iam.WorkloadIdentityPool) (*iam.Operation, error)
	GetWorkloadIdentityPool(context.Context, string) (*iam.WorkloadIdentityPool, error)
	DeleteWorkloadIdentityPool(context.Context, string) (*iam.Operation, error)
	UndeleteWorkloadIdentityPool(context.Context, string, *iam.UndeleteWorkloadIdentityPoolRequest) (*iam.Operation, error)
	CreateWorkloadIdentityProvider(context.Context, string, string, *iam.WorkloadIdentityPoolProvider) (*iam.Operation, error)
	GetWorkloadIdentityProvider(context.Context, string) (*iam.WorkloadIdentityPoolProvider, error)

	//CloudResourceManager
	GetProjectName() string
	GetProject(ctx context.Context, projectName string) (*cloudresourcemanager.Project, error)
	GetProjectIamPolicy(string, *cloudresourcemanager.GetIamPolicyRequest) (*cloudresourcemanager.Policy, error)
	SetProjectIamPolicy(string, *cloudresourcemanager.SetIamPolicyRequest) (*cloudresourcemanager.Policy, error)
	GetServiceAccountIamPolicy(string) (*iam.Policy, error)
	SetServiceAccountIamPolicy(string, *iam.SetIamPolicyRequest) (*iam.Policy, error)
	TestIamPermissions(string, *cloudresourcemanager.TestIamPermissionsRequest) (*cloudresourcemanager.TestIamPermissionsResponse, error)

	//ServiceUsage
	ListServicesEnabled() (map[string]bool, error)

	//Storage
	CreateBucket(context.Context, string, string, *storage.BucketAttrs) error
	GetBucketAttrs(context.Context, string) (*storage.BucketAttrs, error)
	GetBucketPolicy(context.Context, string) (*iamcloud.Policy3, error)
	SetBucketPolicy(context.Context, string, *iamcloud.Policy3) error
	DeleteBucket(context.Context, string) error
	ListObjects(context.Context, string) ([]*storage.ObjectAttrs, error)
	PutObject(context.Context, string, string, []byte) error
	DeleteObject(context.Context, string, string) error
}

Client is a wrapper object for actual GCP libraries to allow for easier mocking/testing.

func NewClient

func NewClient(projectName string, creds *google.Credentials) (Client, error)

NewClient creates our client wrapper object for interacting with GCP.

func NewClientFromJSON

func NewClientFromJSON(projectName string, authJSON []byte) (Client, error)

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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