testutil

package
v0.0.0-...-0e17a7f Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanDatastore

func CleanDatastore(t *testing.T)

func CleanDatastoreBy

func CleanDatastoreBy(t *testing.T, ctx context.Context, client *datastore.Client)

Setup Utilitiy

func EqualBoardEntitiesAsSet

func EqualBoardEntitiesAsSet(t *testing.T,
	keyFunc func(a *board.Entity, b *board.Entity) bool,
	as []*board.Entity, bs []*board.Entity) bool

func EqualBoardEntity

func EqualBoardEntity(t *testing.T, a *board.Entity, b *board.Entity) bool

func EqualDatEntity

func EqualDatEntity(t *testing.T, a *dat.Entity, b *dat.Entity) bool

func NewContextAndClient

func NewContextAndClient(t *testing.T) (ctx context.Context, client *datastore.Client)

func NewSettingStub

func NewSettingStub() bbscfg.Setting

func NewTimeJST

func NewTimeJST(t *testing.T, datetime string) time.Time

Types

type BoardStub

type BoardStub struct {
	BoardMap map[string]*board.Entity
	DatMap   map[string]map[string]*dat.Entity
}

A injection for google datastore

func EmptyBoardStub

func EmptyBoardStub() *BoardStub

func InitialBoardStub

func InitialBoardStub(boardNameList ...string) *BoardStub

func NewBoardStub

func NewBoardStub(boardName string, threads []ThreadStub) *BoardStub

func (*BoardStub) BoardKey

func (repo *BoardStub) BoardKey(name string) (key *board.Key)

func (*BoardStub) DatKey

func (repo *BoardStub) DatKey(name string, parent *board.Key) (key *dat.Key)

func (*BoardStub) GetAllBoard

func (repo *BoardStub) GetAllBoard(entities *[]*board.Entity) (keys []*board.Key, err error)

func (*BoardStub) GetBoard

func (repo *BoardStub) GetBoard(key *board.Key, entity *board.Entity) (err error)

func (*BoardStub) GetDat

func (repo *BoardStub) GetDat(key *dat.Key, entity *dat.Entity) (err error)

func (*BoardStub) PutBoard

func (repo *BoardStub) PutBoard(key *board.Key, entity *board.Entity) (err error)

func (*BoardStub) PutDat

func (repo *BoardStub) PutDat(key *dat.Key, entity *dat.Entity) (err error)

func (*BoardStub) RunInTransaction

func (repo *BoardStub) RunInTransaction(f func(tx *datastore.Transaction) error) (err error)

func (*BoardStub) TxGetAllBoard

func (repo *BoardStub) TxGetAllBoard(tx *datastore.Transaction, entities *[]*board.Entity) (keys []*board.Key, err error)

func (*BoardStub) TxGetBoard

func (repo *BoardStub) TxGetBoard(tx *datastore.Transaction, key *board.Key, entity *board.Entity) (err error)

func (*BoardStub) TxGetDat

func (repo *BoardStub) TxGetDat(tx *datastore.Transaction, key *dat.Key, entity *dat.Entity) (err error)

func (*BoardStub) TxPutBoard

func (repo *BoardStub) TxPutBoard(tx *datastore.Transaction, key *board.Key, entity *board.Entity) (err error)

func (*BoardStub) TxPutDat

func (repo *BoardStub) TxPutDat(tx *datastore.Transaction, key *dat.Key, entity *dat.Entity) (err error)

func (*BoardStub) TxPutMultiBoard

func (repo *BoardStub) TxPutMultiBoard(tx *datastore.Transaction, keys []*board.Key, entities []*board.Entity) (err error)

type BrokenBoardStub

type BrokenBoardStub struct {
	*BoardStub
}

func NewBrokenBoardStub

func NewBrokenBoardStub() *BrokenBoardStub

func (*BrokenBoardStub) GetAllBoard

func (repo *BrokenBoardStub) GetAllBoard(entities *[]*board.Entity) (keys []*board.Key, err error)

func (*BrokenBoardStub) TxGetAllBoard

func (repo *BrokenBoardStub) TxGetAllBoard(tx *datastore.Transaction, entities *[]*board.Entity) (keys []*board.Key, err error)

func (*BrokenBoardStub) TxGetBoard

func (repo *BrokenBoardStub) TxGetBoard(tx *datastore.Transaction, key *board.Key, entity *board.Entity) (err error)

func (*BrokenBoardStub) TxPutMultiBoard

func (repo *BrokenBoardStub) TxPutMultiBoard(tx *datastore.Transaction, keys []*board.Key, entities []*board.Entity) (err error)

type BrokenMemcache

type BrokenMemcache struct {
}

func NewBrokenMemcache

func NewBrokenMemcache() *BrokenMemcache

func (*BrokenMemcache) Delete

func (mem *BrokenMemcache) Delete(key string) error

func (*BrokenMemcache) Get

func (mem *BrokenMemcache) Get(key string) (*memcache.Item, error)

func (*BrokenMemcache) Set

func (mem *BrokenMemcache) Set(item *memcache.Item) error

type SettingStub

type SettingStub struct{}

func (*SettingStub) BBS_4WORLD

func (_ *SettingStub) BBS_4WORLD() string

func (*SettingStub) BBS_ARR

func (_ *SettingStub) BBS_ARR() string

func (*SettingStub) BBS_DISP_IP

func (_ *SettingStub) BBS_DISP_IP() string

func (*SettingStub) BBS_DISP_MSEC

func (_ *SettingStub) BBS_DISP_MSEC() int

func (*SettingStub) BBS_FORCE_ID

func (_ *SettingStub) BBS_FORCE_ID() string

func (*SettingStub) BBS_JP_CHECK

func (_ *SettingStub) BBS_JP_CHECK() string

func (*SettingStub) BBS_MAIL_COUNT

func (_ *SettingStub) BBS_MAIL_COUNT() int

func (*SettingStub) BBS_MESSAGE_COUNT

func (_ *SettingStub) BBS_MESSAGE_COUNT() int

func (*SettingStub) BBS_NAME_COUNT

func (_ *SettingStub) BBS_NAME_COUNT() int

func (*SettingStub) BBS_NONAME_NAME

func (_ *SettingStub) BBS_NONAME_NAME() string

func (*SettingStub) BBS_NO_ID

func (_ *SettingStub) BBS_NO_ID() string

func (*SettingStub) BBS_SLIP

func (_ *SettingStub) BBS_SLIP() string

func (*SettingStub) BBS_SOKO

func (_ *SettingStub) BBS_SOKO() string

func (*SettingStub) BBS_SUBJECT_COUNT

func (_ *SettingStub) BBS_SUBJECT_COUNT() int

func (*SettingStub) BBS_THREAD_TATESUGI

func (_ *SettingStub) BBS_THREAD_TATESUGI() int

func (*SettingStub) BBS_TITLE

func (_ *SettingStub) BBS_TITLE() string

func (*SettingStub) BBS_UNICODE

func (_ *SettingStub) BBS_UNICODE() string

func (*SettingStub) BBS_YMD_WEEKS

func (_ *SettingStub) BBS_YMD_WEEKS() string

func (*SettingStub) STUB_DAT_CAPACITY

func (_ *SettingStub) STUB_DAT_CAPACITY() int

func (*SettingStub) STUB_MESSAGE_COUNT

func (_ *SettingStub) STUB_MESSAGE_COUNT() int

func (*SettingStub) STUB_THREAD_COUNT

func (_ *SettingStub) STUB_THREAD_COUNT() int

func (*SettingStub) STUB_WRITE_ENTITY_LIMIT

func (_ *SettingStub) STUB_WRITE_ENTITY_LIMIT() int

type ThreadStub

type ThreadStub struct {
	ThreadKey    string
	ThreadTitle  string
	MessageCount int
	LastModified time.Time
	Dat          string
}

Jump to

Keyboard shortcuts

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