manipulator

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModtimeUser  = 1
	ModtimeSlave = 2
	ModtimeGroup = 3
)

Variables

This section is empty.

Functions

func Begin

func Begin(ctx ...context.Context) (*xorm.Session, error)

func DeleteCache

func DeleteCache(tableName string, pk ...interface{}) error

func Engine

func Engine() *xorm.EngineGroup

func Init

func Init(cnf *configure.DB)

Init Initialize the database

func LastETag

func LastETag(id int32) (etag string, e error)

func LastModified

func LastModified(id int32) (modtime time.Time, e error)

func Master

func Master() *xorm.Engine

func Session

func Session(ctx ...context.Context) *xorm.Session

func SetETag

func SetETag(id int32, etag string) (int64, error)

func SetLastModified

func SetLastModified(id int32, modtime time.Time) (int64, error)

func Slave

func Slave() *xorm.Engine

func SyncTable

func SyncTable(session *xorm.Session, beans ...interface{}) (e error)

SyncTable sync table to consistent

Types

type ModtimeHelper

type ModtimeHelper int32

ModtimeHelper modtime update helper

func (ModtimeHelper) ETag

func (h ModtimeHelper) ETag(session *xorm.Session, etag string) (int64, error)

ETag set last etag

func (ModtimeHelper) Init

func (h ModtimeHelper) Init(session *xorm.Session, unix int64, etag, description string) (e error)

func (ModtimeHelper) LastETag

func (h ModtimeHelper) LastETag() (string, error)

func (ModtimeHelper) LastModified

func (h ModtimeHelper) LastModified() (time.Time, error)

func (ModtimeHelper) Modified

func (h ModtimeHelper) Modified(session *xorm.Session, modtime time.Time) (int64, error)

Modified set last modified

Jump to

Keyboard shortcuts

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