google

package
v0.0.0-...-d2fb36c Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseProjectID

func ParseProjectID(resourceName string) (string, error)

func ParseSecretName

func ParseSecretName(resourceName string) (string, error)

func ParseSecretVersion

func ParseSecretVersion(resourceName string) string

func ToAccessSecretVersionRequest

func ToAccessSecretVersionRequest(projectID, secretName string) *secretmanagerpb.AccessSecretVersionRequest

func ToGetSecretRequest

func ToGetSecretRequest(projectID, secretName string) *secretmanagerpb.GetSecretRequest

Types

type PubSubClient

type PubSubClient struct {
	*pubsub.Subscription
}

func NewPubSubClient

func NewPubSubClient(ctx context.Context, projectID, subscriptionName string) (*PubSubClient, error)

func (*PubSubClient) Consume

func (in *PubSubClient) Consume(ctx context.Context) chan PubSubMessage

type PubSubMessage

type PubSubMessage interface {
	Ack()
	GetPrincipalEmail() string
	GetProjectID() string
	GetSecretName() string
	GetSecretVersion() string
	GetTimestamp() time.Time
}

type SecretManagerClient

type SecretManagerClient interface {
	GetSecretData(ctx context.Context, projectID, secretName string) ([]byte, error)
	GetSecretMetadata(ctx context.Context, projectID, secretName string) (*secretmanagerpb.Secret, error)
}

func NewSecretManagerClient

func NewSecretManagerClient(ctx context.Context) (SecretManagerClient, error)

Jump to

Keyboard shortcuts

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