pubsub

package
v0.0.0-...-611ff29 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const MetadataEndpoint = "http://metadata/computeMetadata/v1/instance/attributes/cluster-name"

MetadataEndpoint - default metadata server for gcloud pubsub

Variables

This section is empty.

Functions

func WithKeepAliveDialer

func WithKeepAliveDialer() grpc.DialOption

WithKeepAliveDialer - required so connections aren't dropped https://github.com/GoogleCloudPlatform/google-cloud-go/issues/500

Types

type DefaultManager

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

DefaultManager - subscription manager

func NewDefaultManager

func NewDefaultManager(clusterName, projectID string, providers provider.Providers, subClient Subscriber) *DefaultManager

NewDefaultManager - creates new pubsub manager to create subscription for deployments

func (*DefaultManager) Start

func (s *DefaultManager) Start(ctx context.Context) error

Start - start scanning deployment for changes

type Message

type Message struct {
	Action string `json:"action,omitempty"`
	Digest string `json:"digest"`
	Tag    string `json:"tag,omitempty"`
}

Message - expected message from gcr

type Opts

type Opts struct {
	ProjectID string
	Providers provider.Providers
}

Opts - subscriber options

type PubsubSubscriber

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

PubsubSubscriber is Google Cloud pubsub based subscriber

func NewPubsubSubscriber

func NewPubsubSubscriber(opts *Opts) (*PubsubSubscriber, error)

NewPubsubSubscriber - create new pubsub subscriber

func (*PubsubSubscriber) Subscribe

func (s *PubsubSubscriber) Subscribe(ctx context.Context, topic, subscription string) error

Subscribe - initiate PubsubSubscriber

type Subscriber

type Subscriber interface {
	Subscribe(ctx context.Context, topic, subscription string) error
}

Subscriber - subscribe is responsible to listen for repository events and inform providers

Jump to

Keyboard shortcuts

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