subscriber

package
v2.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Server         *server.Server
	Project        string
	Subscription   string
	RequiredChecks []string
	DryRun         bool
	Timeout        int
}

Config stores the necessary details for a Subscriber

func (*Config) TimeoutDuration

func (c *Config) TimeoutDuration() time.Duration

TimeoutDuration returns the configured timeout for this Server.

type Payload

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

Payload contains the information from the pub/sub message

type Subscriber

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

Subscriber contains the information required to pull messages from a pub/sub topic.

func NewSubscriber

func NewSubscriber(config *Config, secrets *config.Secrets, metrics metrics.Client, log *logrus.Logger) *Subscriber

NewSubscriber creates a new subscription topic puller for a subscription.

func (*Subscriber) Subscribe

func (s *Subscriber) Subscribe(ctx context.Context) error

Subscribe pulls messages for a subscription and passes them along to get checked.

Jump to

Keyboard shortcuts

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