msg

package
v1.0.1-0...-20e81f0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 8 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 {
	SourceFormat string
	Validate     bool
	DestURL      string
}

func NewConfig

func NewConfig(format string, validate bool, dest string) *Config

NewConfig return a config

func (*Config) IsSourceJSON

func (c *Config) IsSourceJSON() bool

IsSourceJSON returns true if source format is json

func (*Config) RunValidation

func (c *Config) RunValidation() error

type Request

type Request struct {
	EventID string
	Data    []byte `json:"data"`
}

Request represents a service request

type Response

type Response struct {
	Status  string
	Error   string
	EventID string
	Size    int
	URL     string
}

Response represents a response

func NewResponse

func NewResponse(eventID string) *Response

NewResponse creates a response

type Service

type Service interface {
	Proxy(context.Context, *Request) *Response
}

Service service to proxy pubsub topic payload to google storage with or without validation

func New

func New(config *Config, fs afs.Service) Service

New create a service service

func Singleton

func Singleton(config *Config) Service

Singleton returns new service for env key

Jump to

Keyboard shortcuts

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