gcpclient

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InventoryEventBucketPrefix   = "//storage.googleapis.com/"
	InventoryEventFunctionPrefix = "//run.googleapis.com/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket struct {
	Name string
}

func (*Bucket) AssetName

func (b *Bucket) AssetName() string

type Function

type Function struct {
	Name string `json:"name"`
}

func (*Function) AssetName

func (f *Function) AssetName() string

type GCP

type GCP interface {
	ListBuckets(ctx context.Context) ([]*Bucket, error)
	ListFunctions(ctx context.Context) ([]*Function, error)
	Listen(ctx context.Context, handler ListenerFunc) error
	Close() error
}

func New

func New(ctx context.Context, log *logrus.Logger, config GCPConfig) (GCP, error)

type GCPConfig

type GCPConfig struct {
	ProjectID          string
	AckDeadlineSeconds int
	TopicName          string
	SubscriptionID     string
	CredentialsJSON    string
}

type ListenerFunc

type ListenerFunc func(ctx context.Context, data []byte) error

type MockPubSub

type MockPubSub struct {
	ListenError  error
	ListenAssert func(ctx context.Context, handler ListenerFunc)

	CloseError error

	ListBucketsResult []*Bucket
	ListBucketsError  error

	ListFunctionsResult []*Function
	ListFunctionsError  error
	// contains filtered or unexported fields
}

func (*MockPubSub) Close

func (m *MockPubSub) Close() error

func (*MockPubSub) CloseInvoked

func (m *MockPubSub) CloseInvoked() bool

func (*MockPubSub) ListBuckets

func (m *MockPubSub) ListBuckets(_ context.Context) ([]*Bucket, error)

func (*MockPubSub) ListBucketsInvoked

func (m *MockPubSub) ListBucketsInvoked() bool

func (*MockPubSub) ListFunctions

func (m *MockPubSub) ListFunctions(_ context.Context) ([]*Function, error)

func (*MockPubSub) ListFunctionsInvoked

func (m *MockPubSub) ListFunctionsInvoked() bool

func (*MockPubSub) Listen

func (m *MockPubSub) Listen(ctx context.Context, handler ListenerFunc) error

func (*MockPubSub) ListenInvoked

func (m *MockPubSub) ListenInvoked() bool

Jump to

Keyboard shortcuts

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