cameraClient

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DimensionCacheKey

func DimensionCacheKey(dim Dimension) string

Types

type CameraPicture

type CameraPicture interface {
	JpgImg() []byte
	DecodedImg() image.Image
	Fetched() time.Time
	Expires() time.Time
	Expired(delay time.Duration) bool
	Uuid() string
	Err() error
}

type Client

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

func RunClient

func RunClient(config Config) (*Client, error)

func (*Client) Config

func (c *Client) Config() Config

func (*Client) GetDelayedImage

func (c *Client) GetDelayedImage(refreshInterval time.Duration) *cameraPicture

func (*Client) GetRawImage

func (c *Client) GetRawImage() *cameraPicture

func (*Client) GetResizedImage

func (c *Client) GetResizedImage(refreshInterval time.Duration, dim Dimension, jpgQuality int) *cameraPicture

func (*Client) Name

func (c *Client) Name() string

func (*Client) Shutdown

func (c *Client) Shutdown()

type ClientPool

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

func RunPool

func RunPool() (pool *ClientPool)

func (*ClientPool) AddClient

func (p *ClientPool) AddClient(client *Client)

func (*ClientPool) GetClient

func (p *ClientPool) GetClient(clientName string) *Client

func (*ClientPool) RemoveClient

func (p *ClientPool) RemoveClient(client *Client)

func (*ClientPool) Shutdown

func (p *ClientPool) Shutdown()

type Config

type Config interface {
	Name() string
	Address() string
	User() string
	Password() string
	RefreshInterval() time.Duration
	PreemptiveFetch() time.Duration
	ExpireEarly() time.Duration
	LogDebug() bool
}

type Dimension

type Dimension interface {
	Width() int
	Height() int
}

func DimensionOfImage

func DimensionOfImage(img image.Image) Dimension

Jump to

Keyboard shortcuts

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