mrstorage

package
v0.6.15 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: Apache-2.0 Imports: 4 Imported by: 21

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBConn added in v0.6.0

type DBConn interface {
	Begin(ctx context.Context) (DBTransaction, error)
	DBQuery
}

type DBQuery added in v0.6.0

type DBQuery interface {
	Query(ctx context.Context, sql string, args ...any) (DBQueryRows, error)
	QueryRow(ctx context.Context, sql string, args ...any) DBQueryRow
	Exec(ctx context.Context, sql string, args ...any) error
}

type DBQueryRow added in v0.6.0

type DBQueryRow interface {
	Scan(dest ...any) error
}

type DBQueryRows added in v0.6.0

type DBQueryRows interface {
	Next() bool
	Scan(dest ...any) error
	Err() error
	Close()
}

type DBTransaction added in v0.6.0

type DBTransaction interface {
	Commit(ctx context.Context) error
	Rollback(ctx context.Context) error
	DBQuery
}

type FileProviderAPI added in v0.6.0

type FileProviderAPI interface {
	Info(ctx context.Context, filePath string) (mrtype.FileInfo, error)
	Download(ctx context.Context, filePath string) (mrtype.File, error)
	Upload(ctx context.Context, file mrtype.File) error
	Remove(ctx context.Context, filePath string) error
}

type FileProviderPool added in v0.6.5

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

func NewFileProviderPool added in v0.6.5

func NewFileProviderPool() *FileProviderPool

func (*FileProviderPool) Provider added in v0.6.5

func (p *FileProviderPool) Provider(name string) (FileProviderAPI, error)

func (*FileProviderPool) Register added in v0.6.5

func (p *FileProviderPool) Register(name string, provider FileProviderAPI) error

type SqlBuilderOrderBy added in v0.5.0

type SqlBuilderOrderBy interface {
	WrapWithDefault(field SqlBuilderPartFunc) SqlBuilderPartFunc
	Join(fields ...SqlBuilderPartFunc) SqlBuilderPartFunc
	Field(name string, direction mrenum.SortDirection) SqlBuilderPartFunc
}

type SqlBuilderPager added in v0.5.0

type SqlBuilderPager interface {
	OffsetLimit(index, size uint64) SqlBuilderPartFunc
}

type SqlBuilderPart added in v0.5.0

type SqlBuilderPart interface {
	WithPrefix(value string) SqlBuilderPart
	Param(number int) SqlBuilderPart
	Empty() bool
	ToSql() (string, []any)
	fmt.Stringer
}

type SqlBuilderPartFunc added in v0.5.0

type SqlBuilderPartFunc func(paramNumber int) (string, []any)

func SqlBuilderPartFuncRemoveNil added in v0.5.0

func SqlBuilderPartFuncRemoveNil(parts []SqlBuilderPartFunc) []SqlBuilderPartFunc

type SqlBuilderSelect added in v0.5.0

type SqlBuilderSelect interface {
	Where(f func(w SqlBuilderWhere) SqlBuilderPartFunc) SqlBuilderPart
	OrderBy(f func(o SqlBuilderOrderBy) SqlBuilderPartFunc) SqlBuilderPart
	Pager(f func(p SqlBuilderPager) SqlBuilderPartFunc) SqlBuilderPart
}

type SqlBuilderSet added in v0.5.0

type SqlBuilderSet interface {
	Join(fields ...SqlBuilderPartFunc) SqlBuilderPartFunc
	Field(name string, value any) SqlBuilderPartFunc
	Fields(names []string, args []any) SqlBuilderPartFunc
}

type SqlBuilderUpdate added in v0.5.0

type SqlBuilderUpdate interface {
	Set(f func(s SqlBuilderSet) SqlBuilderPartFunc) SqlBuilderPart
	SetFromEntity(entity any) (SqlBuilderPart, error)
	SetFromEntityWith(entity any, extFields func(s SqlBuilderSet) SqlBuilderPartFunc) (SqlBuilderPart, error)
}

type SqlBuilderWhere added in v0.5.0

type SqlBuilderWhere interface {
	JoinAnd(conds ...SqlBuilderPartFunc) SqlBuilderPartFunc
	JoinOr(conds ...SqlBuilderPartFunc) SqlBuilderPartFunc
	Expr(expr string) SqlBuilderPartFunc
	ExprWithValue(expr string, value any) SqlBuilderPartFunc
	Equal(name string, value any) SqlBuilderPartFunc
	NotEqual(name string, value any) SqlBuilderPartFunc
	Less(name string, value any) SqlBuilderPartFunc
	LessOrEqual(name string, value any) SqlBuilderPartFunc
	Greater(name string, value any) SqlBuilderPartFunc
	GreaterOrEqual(name string, value any) SqlBuilderPartFunc
	FilterEqualString(name, value string) SqlBuilderPartFunc
	FilterEqualInt64(name string, value, empty int64) SqlBuilderPartFunc
	FilterEqualBool(name string, value *bool) SqlBuilderPartFunc
	FilterLike(name, value string) SqlBuilderPartFunc
	FilterLikeFields(names []string, value string) SqlBuilderPartFunc
	FilterRangeInt64(name string, value mrtype.RangeInt64, empty int64) SqlBuilderPartFunc
	// FilterAnyOf - 'values' support only slices else the func returns nil
	FilterAnyOf(name string, values any) SqlBuilderPartFunc
}

type SqlSelectParams added in v0.5.0

type SqlSelectParams struct {
	Where   SqlBuilderPart
	OrderBy SqlBuilderPart
	Pager   SqlBuilderPart
}

Jump to

Keyboard shortcuts

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