store

package
v0.0.0-...-ae8f47d Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Data

func Data(config StoreConfig) mongo.DBConn

func StoreConfigs

func StoreConfigs(dbName string, collections []string, local bool) map[string]StoreConfig

Types

type AccessStore

type AccessStore interface {
	CreateAccessCode(bedAccess types.BedAccess) error
	GetAccess(bedId string) (types.BedAccess, error)
}

func NewAccessStore

func NewAccessStore(config StoreConfig) AccessStore

type BedUserStore

type BedUserStore interface {
	CreateBedUser(bedUser types.BedUser) error
	GetBed(bedId string) (types.BedUser, error)
	GetBedUserByUserId(userId string) (types.BedUser, error)
	GetByBuildingId(buildingId string) ([]types.BedUser, error)
	GetUsersByBedIds(bedIds []string) ([]types.BedUser, error)
	DeleteBedUser(bedUser types.BedUser) error
}

func NewBedUserStore

func NewBedUserStore(config StoreConfig) BedUserStore

type BuildingBedStore

type BuildingBedStore interface {
	CreateBeds(buildingBeds []types.BuildingBed) error
	GetByBedId(bedId string) (types.BuildingBed, error)
	GetBedsByBuildingId(buildingId string) ([]types.BuildingBed, error)
}

func NewBuildingBedStore

func NewBuildingBedStore(config StoreConfig) BuildingBedStore

type BuildingStore

type BuildingStore interface {
	Create(building types.Building) error
	GetById(id string) (types.Building, error)
	GetBuildings() ([]types.Building, error)
}

func NewBuildingStore

func NewBuildingStore(config StoreConfig) BuildingStore

type MachineStore

type MachineStore interface {
	CreateMachines(machine []types.Machine) error
	GetMachines(buildingId string) ([]types.Machine, error)
	GetMachine(id string) (types.Machine, error)
	UpdateMachine(machine types.Machine) ([]types.Machine, error)
}

func NewMachineStore

func NewMachineStore(config StoreConfig) MachineStore

type MongoStore

type MongoStore struct {
	Client     mongo.DBConn
	Collection string
}

func NewStoreConn

func NewStoreConn(config StoreConfig) *MongoStore

type RoomSharingStore

type RoomSharingStore interface {
	CreateRooms(roomSharing []types.RoomSharing) error
}

func NewRoomSharingStore

func NewRoomSharingStore(config StoreConfig) RoomSharingStore

type StoreConfig

type StoreConfig struct {
	DbName    string
	TableName string
	Local     bool
}

type UsageStore

type UsageStore interface {
	Create(usage types.Usage) error
	GetByMachineId(machineId string) (types.Usage, error)
	GetByMachineIds(machineIds []string) ([]types.Usage, error)
	SaveUsage(usage types.Usage) error
	DeleteUsage(machineId string) error
}

func NewUsageStore

func NewUsageStore(config StoreConfig) UsageStore

type UserStore

type UserStore interface {
	CreateUser(user types.User) error
	GetUser(id string) (types.User, error)
	GetByUsername(username string) (types.User, error)
	GetUsers(ids []string) ([]types.User, error)
	GetByUsernames(usernames []string) ([]types.User, error)
	GetByRole(role role.Role) ([]types.User, error)
	UpdateUser(user types.User) error
}

func NewUserStore

func NewUserStore(config StoreConfig) UserStore

Jump to

Keyboard shortcuts

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