session

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2019 License: MIT Imports: 17 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("session: nil")

ErrNotFound err not found

Functions

func IsErrNotFound

func IsErrNotFound(err error) bool

IsErrNotFound is err not found

func RegisterSetdb

func RegisterSetdb(fn SetdbFunc)

func Setdb

func Setdb(s *Session) error

Types

type Session

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

Session session

func New

func New(data []byte) (*Session, error)

New new session

func NewWithReader

func NewWithReader(r io.Reader) (*Session, error)

NewWithReader new session with reader

func NewWithViper

func NewWithViper(v *viper.Viper) *Session

NewWithViper new session with viper

func (*Session) AWSSession

func (s *Session) AWSSession() *session.Session

AWSSession aws session

func (*Session) Close

func (s *Session) Close()

Close close

func (*Session) Context

func (s *Session) Context() context.Context

Context context

func (*Session) Copy

func (s *Session) Copy() *Session

Copy copy

func (*Session) Deadline

func (s *Session) Deadline() (deadline time.Time, ok bool)

Deadline deadline

func (*Session) Done

func (s *Session) Done() <-chan struct{}

Done done

func (*Session) Err

func (s *Session) Err() error

Err err

func (*Session) IsErrNotFound

func (s *Session) IsErrNotFound(err error) bool

IsErrNotFound is err not found

func (*Session) MemoryCache added in v1.0.3

func (s *Session) MemoryCache() *cache.Cache

MemoryCache memory cache

func (*Session) MysqlBegin

func (s *Session) MysqlBegin() *Session

MysqlBegin mysql begin

func (*Session) MysqlCommit

func (s *Session) MysqlCommit() *gorm.DB

MysqlCommit mysql commit

func (*Session) MysqlRead

func (s *Session) MysqlRead() *gorm.DB

MysqlRead mysql read

func (*Session) MysqlReadOnWrite

func (s *Session) MysqlReadOnWrite() *Session

MysqlReadOnWrite mysql all write

func (*Session) MysqlRollback

func (s *Session) MysqlRollback() *gorm.DB

MysqlRollback mysql rollback

func (*Session) MysqlRollbackUnlessCommitted

func (s *Session) MysqlRollbackUnlessCommitted() *gorm.DB

MysqlRollbackUnlessCommitted rollback unless committed

func (*Session) MysqlWrite

func (s *Session) MysqlWrite() *gorm.DB

MysqlWrite mysql write

func (*Session) Redis

func (s *Session) Redis() *redis.Client

Redis redis

func (*Session) SubViper

func (s *Session) SubViper(key string) *Session

SubViper sub viper

func (*Session) UnmarshalViper

func (s *Session) UnmarshalViper(r interface{}) error

UnmarshalViper unmarshal

func (*Session) UnmarshalViperWithTag

func (s *Session) UnmarshalViperWithTag(r interface{}, tag string) error

UnmarshalViperWithTag unmarshal with tag

func (*Session) Value

func (s *Session) Value(key interface{}) interface{}

Value value

func (*Session) Viper

func (s *Session) Viper() *viper.Viper

Viper viper

func (*Session) WithContext

func (s *Session) WithContext(ctx context.Context) *Session

WithContext with context

type SetdbFunc

type SetdbFunc func(db *gorm.DB) error

Jump to

Keyboard shortcuts

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