repo

package
v1.20.18 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CountRepo added in v1.20.18

type CountRepo interface {
	Find(filter types.Filter, agg string) (types.Counts, error)
	StatsByDashboardCached(dashId int) ([]*types.DashStatRow, error)
	StatsByLognameCached(dashId int, logname string) ([]*types.DashStatRow, error)
	Store(count *_types.Count) error
	StopQueue() error
}

type DashboardKeyRepo

type DashboardKeyRepo interface {
	GetById(id int) (*types.DashKey, error)
	GetByIds(ids []int) (types.DashKeys, error)
	GetByDashId(id int) (types.DashKeys, error)
	GetByPubCached(pub string) (*types.DashKey, error)
	Create(key *types.DashKey, tx *sql.Tx) error
}

type DashboardMemberRepo

type DashboardMemberRepo interface {
	GetByDashId(id int) (types.DashMembers, error)
	GetByUserId(id int) (types.DashMembers, error)
	Create(m *types.DashMember) error
	Remove(id int) error
}

type DashboardRepo

type DashboardRepo interface {
	GetAll() (types.Dashboards, error)
	GetById(id int) (*types.Dashboard, error)
	GetByOwnerId(id int) (types.Dashboards, error)
	GetShared(userId int, role int) (types.Dashboards, error)
	GetSystemIds(role int) []int
	Create(dash *types.Dashboard) error
	Update(dash *types.Dashboard) error
	Remove(id int) error
}

type LogRepo added in v1.20.18

type LogRepo interface {
	GetByFilter(filter types.Filter) (_types.Logs, error)
	StatsByDashboardCached(dashId int) ([]*types.DashStatRow, error)
	StatsByLognameCached(dashId int, logname string) ([]*types.DashStatRow, error)
	Store(log *_types.Log) error
	StopQueue() error
}

type Repos

type Repos struct {
	User            UserRepo
	Dashboard       DashboardRepo
	DashboardMember DashboardMemberRepo
	DashboardKey    DashboardKeyRepo
	Count           CountRepo
	Log             LogRepo
}

func GetRepos

func GetRepos() *Repos

type UserRepo

type UserRepo interface {
	GetAll() (types.Users, error)
	GetById(id int) (*types.User, error)
	GetByUsername(username string) (*types.User, error)
	Upsert(githubId int64, username string, role int) (*types.User, error)
	Create(githubId int64, username string, role int) (*types.User, error)
	LoginAt(id int) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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