sqlite

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2023 License: BSD-3-Clause Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAssetNotFound = errors.New("asset not found")
View Source
var ErrCommittingSession = errors.New("error committing sessions")
View Source
var ErrCreatingAsset = errors.New("error creating asset")
View Source
var ErrCreatingFile = errors.New("error creating file")
View Source
var ErrFileNotFound = errors.New("file not found")
View Source
var ErrFindingSession = errors.New("error finding sessions")
View Source
var ErrLocalAuthUserNotFound = errors.New("user for local auth not found")
View Source
var ErrTagNotFound = errors.New("tag not found")
View Source
var ErrUserNotFound = errors.New("user not found")

Functions

func NewSQLiteDB

func NewSQLiteDB(config *Config) (*sql.DB, error)

func RunMigrations

func RunMigrations(ctx context.Context, db *sql.DB) error

Types

type AssetRepo added in v0.3.0

type AssetRepo struct{}

func (*AssetRepo) Create added in v0.3.0

func (ar *AssetRepo) Create(ctx context.Context, exec bob.Executor, asset *entities.Asset) error

func (*AssetRepo) Delete added in v0.3.0

func (ar *AssetRepo) Delete(ctx context.Context, exec bob.Executor, id int64) error

func (*AssetRepo) Get added in v0.3.0

func (*AssetRepo) List added in v0.3.0

func (*AssetRepo) Update added in v0.3.0

func (ar *AssetRepo) Update(ctx context.Context, exec bob.Executor, asset *entities.Asset) error

type CategoryRepo added in v0.3.0

type CategoryRepo struct{}

func (*CategoryRepo) List added in v0.3.0

type Config added in v0.8.2

type Config struct {
	File      string
	Timeout   time.Duration
	EnableWAL bool
}

type CustomAttrRepo added in v0.3.0

type CustomAttrRepo struct{}

func (*CustomAttrRepo) List added in v0.3.0

type FileRepo added in v0.3.0

type FileRepo struct{}

func (*FileRepo) Create added in v0.3.0

func (fr *FileRepo) Create(ctx context.Context, exec bob.Executor, file *entities.File) (int64, error)

func (*FileRepo) Delete added in v0.3.0

func (fr *FileRepo) Delete(ctx context.Context, exec bob.Executor, ids []int64) error

func (*FileRepo) Get added in v0.3.0

func (fr *FileRepo) Get(ctx context.Context, exec bob.Executor, id int64) (*entities.File, error)

func (*FileRepo) GetByPublicPath added in v0.3.0

func (fr *FileRepo) GetByPublicPath(ctx context.Context, exec bob.Executor, publicPath string) (*entities.File, error)

func (*FileRepo) List added in v0.3.0

type LocalAuthRepo added in v0.3.0

type LocalAuthRepo struct{}

func (*LocalAuthRepo) Create added in v0.3.0

func (*LocalAuthRepo) Create(ctx context.Context, exec bob.Executor, user *auth.LocalAuthUser) error

func (*LocalAuthRepo) DeleteByUsername added in v0.3.0

func (*LocalAuthRepo) DeleteByUsername(ctx context.Context, exec bob.Executor, username string) error

func (*LocalAuthRepo) Get added in v0.3.0

func (*LocalAuthRepo) Get(ctx context.Context, exec bob.Executor, username string) (*auth.LocalAuthUser, error)

func (*LocalAuthRepo) Update added in v0.3.0

func (*LocalAuthRepo) Update(ctx context.Context, exec bob.Executor, user *auth.LocalAuthUser) error

type LocationRepo added in v0.3.0

type LocationRepo struct{}

func (*LocationRepo) ListLocations added in v0.3.0

func (*LocationRepo) ListPositionCodes added in v0.3.0

type ManufacturerRepo added in v0.3.0

type ManufacturerRepo struct{}

func (*ManufacturerRepo) List added in v0.3.0

type ModelRepo added in v0.3.0

type ModelRepo struct{}

func (*ModelRepo) List added in v0.3.0

type SQLiteSessionStore

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

func NewSQLiteSessionStore

func NewSQLiteSessionStore(db *database.Database) *SQLiteSessionStore

func (*SQLiteSessionStore) Commit

func (s *SQLiteSessionStore) Commit(token string, b []byte, expiry time.Time) error

func (*SQLiteSessionStore) CommitCtx added in v0.8.2

func (s *SQLiteSessionStore) CommitCtx(ctx context.Context, token string, b []byte, expiry time.Time) error

func (*SQLiteSessionStore) Delete

func (s *SQLiteSessionStore) Delete(token string) error

func (*SQLiteSessionStore) DeleteCtx added in v0.8.2

func (s *SQLiteSessionStore) DeleteCtx(ctx context.Context, token string) error

func (*SQLiteSessionStore) Find

func (s *SQLiteSessionStore) Find(token string) ([]byte, bool, error)

func (*SQLiteSessionStore) FindCtx added in v0.8.2

func (s *SQLiteSessionStore) FindCtx(ctx context.Context, token string) ([]byte, bool, error)

type SupplierRepo added in v0.3.0

type SupplierRepo struct{}

func (*SupplierRepo) List added in v0.3.0

type TagRepo added in v0.3.0

type TagRepo struct{}

func (*TagRepo) Create added in v0.3.0

func (*TagRepo) Create(ctx context.Context, exec bob.Executor, tag *entities.Tag) error

func (*TagRepo) Delete added in v0.3.0

func (*TagRepo) Delete(ctx context.Context, exec bob.Executor, tag string) error

func (*TagRepo) Get added in v0.3.0

func (*TagRepo) Get(ctx context.Context, exec bob.Executor, tag string) (*entities.Tag, error)

func (*TagRepo) GetUnused added in v0.3.0

func (*TagRepo) GetUnused(ctx context.Context, exec bob.Executor) (*entities.Tag, error)

func (*TagRepo) List added in v0.3.0

func (*TagRepo) MarkTagUnused added in v0.3.0

func (*TagRepo) MarkTagUnused(ctx context.Context, exec bob.Executor, tag string) error

func (*TagRepo) MarkTagUsed added in v0.3.0

func (*TagRepo) MarkTagUsed(ctx context.Context, exec bob.Executor, tag string) error

func (*TagRepo) NextSequential added in v0.3.0

func (*TagRepo) NextSequential(ctx context.Context, exec bob.Executor) (int64, error)

type UserRepo added in v0.3.0

type UserRepo struct{}

func (*UserRepo) CountAdmins added in v0.3.0

func (*UserRepo) CountAdmins(ctx context.Context, exec bob.Executor) (int64, error)

func (*UserRepo) Create added in v0.3.0

func (*UserRepo) Create(ctx context.Context, exec bob.Executor, toCreate *auth.User) error

func (*UserRepo) Delete added in v0.3.0

func (*UserRepo) Delete(ctx context.Context, exec bob.Executor, id int64) error

func (*UserRepo) Get added in v0.3.0

func (*UserRepo) Get(ctx context.Context, exec bob.Executor, id int64) (*auth.User, error)

func (*UserRepo) GetByRef added in v0.3.0

func (*UserRepo) GetByRef(ctx context.Context, exec bob.Executor, ref string) (*auth.User, error)

func (*UserRepo) GetByUsername added in v0.3.0

func (*UserRepo) GetByUsername(ctx context.Context, exec bob.Executor, username string) (*auth.User, error)

func (*UserRepo) List added in v0.3.0

func (*UserRepo) Update added in v0.3.0

func (*UserRepo) Update(ctx context.Context, exec bob.Executor, toUpdate *auth.User) error

func (*UserRepo) UpsertPreferences added in v0.7.0

func (*UserRepo) UpsertPreferences(ctx context.Context, exec bob.Executor, user *auth.User) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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