gcp

package
v0.0.0-...-877ff3d Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GCS

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

GCS is Google Cloud Storage client

func NewGCS

func NewGCS(bucket, key string) (*GCS, error)

NewGCS creates new GCS client

func (*GCS) Read

func (s *GCS) Read(data []byte) (int, error)

Read reads data from GCS bucket

func (*GCS) Write

func (s *GCS) Write(data []byte) (int, error)

Write writes data to GCS bucket

type KMS

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

KMS is GCP KMS client

func NewKMS

func NewKMS(project, location, keyring, cryptoKey string) (*KMS, error)

NewKMS returns new GCP Cloud KMS client It returns error if either Google OAuth client or CloudKMS client failed to be created

func (*KMS) Decrypt

func (k *KMS) Decrypt(cipherText []byte) ([]byte, error)

Decrypt decrypts cipherText data and returns it

func (*KMS) Encrypt

func (k *KMS) Encrypt(plainText []byte) ([]byte, error)

Encrypt encrypts plainText data and returns it

Jump to

Keyboard shortcuts

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