relay

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Overview

Package relay contains the HTTP handler and logic for the relay service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Port           string
	ProjectID      string
	RelayTopicID   string
	RelayProjectID string
}

Config defines the set over environment variables required for running this application.

func (*Config) ToFlags

func (cfg *Config) ToFlags(set *cli.FlagSet) *cli.FlagSet

ToFlags binds the config to the give cli.FlagSet and returns it.

func (*Config) Validate

func (cfg *Config) Validate() error

Validate validates the service config after load.

type MessageEnricher

type MessageEnricher interface {
	Enrich(ctx context.Context, req []byte) ([]byte, map[string]string, error)
}

func NewDefaultMessageEnricher

func NewDefaultMessageEnricher() MessageEnricher

type Server

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

Server acts as a HTTP server for handling relay requests.

func NewServer

func NewServer(ctx context.Context, cfg *Config) (*Server, error)

NewServer creates a new instance of the Server.

func (*Server) Routes

func (s *Server) Routes(ctx context.Context) http.Handler

Routes creates a ServeMux of all of the routes that this Router supports.

Jump to

Keyboard shortcuts

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