sql

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBClient

type DBClient interface {
	First(interface{}, ...interface{}) *gorm.DB
	Where(interface{}, ...interface{}) *gorm.DB
	Save(interface{}) *gorm.DB
}

type FSMORM

type FSMORM struct {
	gorm.Model
	User  string
	State int
	Slots string
}

FSMORM models a Finite State Machine with a gorm.Model

func (*FSMORM) TableName

func (*FSMORM) TableName() string

type Store

type Store struct {
	DB DBClient
}

Store models a SQL store for FSM

func NewStore

func NewStore(cfg *config.StoreConfig) (*Store, error)

func (*Store) Exists

func (s *Store) Exists(user string) (e bool)

Exists for Store

func (*Store) Get

func (s *Store) Get(user string) *fsm.FSM

Get method for Store

func (*Store) Set

func (s *Store) Set(user string, m *fsm.FSM)

Set method for Store

Directories

Path Synopsis
Package mocksql is a generated GoMock package.
Package mocksql is a generated GoMock package.

Jump to

Keyboard shortcuts

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