Documentation
¶
Overview ¶
Package stores keeps module state in OhMyServer's shared database for modules that keep it in files when they run on their own. Each type implements an interface the module defines; tables are named after the module they belong to (docs/module-contract.md, Storage).
Index ¶
- func Open(path string) (*sql.DB, error)
- type DHCP
- func (s *DHCP) Config(ctx context.Context) (cfg server.Config, ok bool, err error)
- func (s *DHCP) CreateReservation(ctx context.Context, r *server.Reservation) error
- func (s *DHCP) DeleteLease(ip string) error
- func (s *DHCP) DeleteReservation(ctx context.Context, id int64) error
- func (s *DHCP) Leases(ctx context.Context) ([]server.Lease, error)
- func (s *DHCP) PruneLeases(ctx context.Context, t time.Time) error
- func (s *DHCP) Reservation(ctx context.Context, id int64) (server.Reservation, error)
- func (s *DHCP) Reservations(ctx context.Context) ([]server.Reservation, error)
- func (s *DHCP) SaveConfig(ctx context.Context, cfg server.Config) error
- func (s *DHCP) SaveLease(l server.Lease) error
- func (s *DHCP) UpdateReservation(ctx context.Context, r *server.Reservation) error
- type DockerApps
- type ForwardRules
- func (s *ForwardRules) Create(ctx context.Context, r *forward.Rule) error
- func (s *ForwardRules) Delete(ctx context.Context, id int64) error
- func (s *ForwardRules) Get(ctx context.Context, id int64) (forward.Rule, error)
- func (s *ForwardRules) List(ctx context.Context) ([]forward.Rule, error)
- func (s *ForwardRules) Update(ctx context.Context, r *forward.Rule) error
- type GatewayConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DHCP ¶
type DHCP struct {
// contains filtered or unexported fields
}
DHCP keeps the DHCP server's settings, reservations and leases in the shared database (dhcp-go keeps them in YAML files when it runs on its own). The tables are the ones dhcp-go's own SQLite store created, so existing state carries over.
func (*DHCP) CreateReservation ¶
CreateReservation inserts r and sets its ID and timestamps.
func (*DHCP) DeleteLease ¶
DeleteLease implements server.LeaseStore.
func (*DHCP) DeleteReservation ¶
DeleteReservation removes a reservation; removing a missing one succeeds.
func (*DHCP) PruneLeases ¶
PruneLeases deletes leases that expired before t.
func (*DHCP) Reservation ¶
Reservation returns one reservation.
func (*DHCP) Reservations ¶
Reservations returns every reservation.
func (*DHCP) SaveConfig ¶
SaveConfig stores the configuration.
func (*DHCP) UpdateReservation ¶
UpdateReservation replaces r's fields.
type DockerApps ¶
type DockerApps struct {
// contains filtered or unexported fields
}
DockerApps keeps docker-go's install records (apps.Store).
func NewDockerApps ¶
NewDockerApps migrates the docker_ tables and returns the store.
type ForwardRules ¶
type ForwardRules struct {
// contains filtered or unexported fields
}
ForwardRules keeps the port forwarder's rules in the shared database (forward-go keeps them in a YAML file when it runs on its own). The table is the one forward-go's own SQLite store created, so existing rules carry over.
func NewForwardRules ¶
NewForwardRules migrates the forward_ tables in db.
func (*ForwardRules) Delete ¶
func (s *ForwardRules) Delete(ctx context.Context, id int64) error
Delete removes a rule; removing a missing rule succeeds.
type GatewayConfig ¶
type GatewayConfig struct {
// contains filtered or unexported fields
}
GatewayConfig keeps the yabber gateway's configuration, which yabber keeps in a YAML file when it runs on its own.
func NewGatewayConfig ¶
NewGatewayConfig migrates the yabber_ tables and returns the store.