storage

package
v0.0.0-...-9a5a174 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 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 Client

type Client struct {
	Gardens                   babyapi.Storage[*pkg.Garden]
	Zones                     babyapi.Storage[*pkg.Zone]
	WaterSchedules            babyapi.Storage[*pkg.WaterSchedule]
	WeatherClientConfigs      babyapi.Storage[*weather.Config]
	NotificationClientConfigs babyapi.Storage[*notifications.Client]
	WaterRoutines             babyapi.Storage[*pkg.WaterRoutine]
}

func NewClient

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

func (*Client) GetWaterSchedulesUsingWeatherClient

func (c *Client) GetWaterSchedulesUsingWeatherClient(id string) ([]*pkg.WaterSchedule, error)

GetWaterSchedulesUsingWeatherClient will return all WaterSchedules that rely on this WeatherClient

func (*Client) GetWeatherClient

func (c *Client) GetWeatherClient(id xid.ID) (weather.Client, error)

GetWeatherClient ...

func (*Client) GetZonesUsingWaterSchedule

func (c *Client) GetZonesUsingWaterSchedule(id string) ([]*pkg.ZoneAndGarden, error)

GetZonesUsingWaterSchedule will find all Zones that use this WaterSchedule and return the Zones along with the Gardens they belong to

func (*Client) RunGardenAndZoneMigrations

func (c *Client) RunGardenAndZoneMigrations(ctx context.Context) error

func (*Client) RunMigrations

func (c *Client) RunMigrations(ctx context.Context) error

func (*Client) RunWaterScheduleMigrations

func (c *Client) RunWaterScheduleMigrations(ctx context.Context) error

func (*Client) RunZoneMigrations

func (c *Client) RunZoneMigrations(ctx context.Context, g *pkg.Garden) error

type Config

type Config struct {
	Driver  string         `mapstructure:"driver" yaml:"driver"`
	Options map[string]any `mapstructure:"options" yaml:"options"`
}

Config is used to identify and configure a storage client

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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