proxy

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPProxyConfig

type HTTPProxyConfig struct {
	ChunkSize    int
	Authenticate bool
	Token        string
	Username     string
	Password     string
	RegistryURL  string
}

func (*HTTPProxyConfig) FetchFromReg

func (c *HTTPProxyConfig) FetchFromReg(ctx context.Context, containerPath string, chunkSize int) ([]proplet.ChunkPayload, error)

type MQTTProxyConfig

type MQTTProxyConfig struct {
	BrokerURL string
	Password  string
	PropletID string
	ChannelID string
}

type ProxyService

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

func NewService

func NewService(ctx context.Context, mqttCfg *MQTTProxyConfig, httpCfg *HTTPProxyConfig, logger *slog.Logger) (*ProxyService, error)

func (*ProxyService) ContainerChan

func (s *ProxyService) ContainerChan() chan string

func (*ProxyService) MQTTClient

func (s *ProxyService) MQTTClient() *RegistryClient

func (*ProxyService) StreamHTTP

func (s *ProxyService) StreamHTTP(ctx context.Context) error

func (*ProxyService) StreamMQTT

func (s *ProxyService) StreamMQTT(ctx context.Context) error

type RegistryClient

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

func NewMQTTClient

func NewMQTTClient(cfg *MQTTProxyConfig) (*RegistryClient, error)

func (*RegistryClient) Connect

func (c *RegistryClient) Connect(ctx context.Context) error

func (*RegistryClient) Disconnect

func (c *RegistryClient) Disconnect(ctx context.Context) error

func (*RegistryClient) PublishContainer

func (c *RegistryClient) PublishContainer(ctx context.Context, chunk proplet.ChunkPayload) error

func (*RegistryClient) Subscribe

func (c *RegistryClient) Subscribe(ctx context.Context, containerChan chan<- string) error

Jump to

Keyboard shortcuts

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