config

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Destination

type Destination struct {
	General

	// TopicID is the configuration of the topic id for the publisher client.
	TopicID string `validate:"required,object_name"`
}

A Destination represents a destination configuration needed for the publisher client.

func ParseDestination

func ParseDestination(cfg map[string]string) (Destination, error)

ParseDestination parses destination configuration into a configuration Destination struct.

type General

type General struct {
	// PrivateKey is the configuration of the private key for the GCP Pub/Sub client.
	PrivateKey string `json:"private_key" validate:"required"`

	// ClientEmail is the configuration of the client's email for the GCP Pub/Sub client.
	ClientEmail string `json:"client_email" validate:"required,email"`

	// ProjectID is the configuration of the project id for the GCP Pub/Sub client.
	ProjectID string `json:"project_id" validate:"required"`

	// Location is the configuration of the location (for GCP Pub/Sub Lite only).
	Location string `json:"location"`
}

A General represents a general configuration needed for GCP Pub/Sub client.

func (General) Marshal

func (cfg General) Marshal() ([]byte, error)

Marshal converts General configuration into a binary representation.

type Source

type Source struct {
	General

	// SubscriptionID is the configuration of the subscription id for the subscriber client.
	SubscriptionID string `validate:"required,object_name"`
}

A Source represents a source configuration needed for the subscriber client.

func ParseSource

func ParseSource(cfg map[string]string) (Source, error)

ParseSource parses source configuration into a configuration Source struct.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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