model

package
v0.6.12 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultClient added in v0.6.1

func DefaultClient() *httpclient.Client

Types

type CacheModel

type CacheModel struct {
	Cache cache.Cache
}

func (*CacheModel) SetCache

func (m *CacheModel) SetCache(name string)

type DBModel added in v0.6.1

type DBModel[T any] struct {
	// contains filtered or unexported fields
}

func (*DBModel[T]) DB added in v0.6.1

func (m *DBModel[T]) DB(dbName string) *mysql.DB

func (*DBModel[T]) Exists added in v0.6.1

func (mdl *DBModel[T]) Exists(cond map[string]any) (bool, error)

func (*DBModel[T]) Find added in v0.6.1

func (mdl *DBModel[T]) Find(cond map[string]any, fields ...string) ([]T, int, error)

func (*DBModel[T]) First added in v0.6.1

func (mdl *DBModel[T]) First(cond map[string]any, fields ...string) (*T, int, error)

func (*DBModel[T]) Insert added in v0.6.1

func (mdl *DBModel[T]) Insert(set map[string]any) (int64, error)

func (*DBModel[T]) QueryBuilder added in v0.6.1

func (m *DBModel[T]) QueryBuilder() mysql.Builder

func (*DBModel[T]) SetDb added in v0.6.1

func (m *DBModel[T]) SetDb(dbname string)

func (*DBModel[T]) SetTable added in v0.6.1

func (m *DBModel[T]) SetTable(table string)

type RpcModel added in v0.6.1

type RpcModel struct {
	Client  *httpclient.Client
	BaseURL string
	IPP     []netip.AddrPort
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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