store

package
v0.0.10 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataStore

type DataStore interface {
	Close() error
	Connect() error
	Init() error
	SaveName(ctx context.Context, steamID steamid.SID64, name string) error
	SaveMessage(ctx context.Context, message *model.UserMessage) error
	SavePlayer(ctx context.Context, state *model.Player) error
	SearchPlayers(ctx context.Context, opts model.SearchOpts) (model.PlayerCollection, error)
	FetchNames(ctx context.Context, sid64 steamid.SID64) (model.UserNameHistoryCollection, error)
	FetchMessages(ctx context.Context, sid steamid.SID64) (model.UserMessageCollection, error)
	LoadOrCreatePlayer(ctx context.Context, steamID steamid.SID64, player *model.Player) error
	GetPlayer(ctx context.Context, steamID steamid.SID64, player *model.Player) error
}

type SqliteStore

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

func New

func New(dsn string, logger *zap.Logger) *SqliteStore

func (*SqliteStore) Close

func (store *SqliteStore) Close() error

func (*SqliteStore) Connect

func (store *SqliteStore) Connect() error

func (*SqliteStore) FetchMessages

func (store *SqliteStore) FetchMessages(ctx context.Context, steamID steamid.SID64) (model.UserMessageCollection, error)

func (*SqliteStore) FetchNames

func (store *SqliteStore) FetchNames(ctx context.Context, steamID steamid.SID64) (model.UserNameHistoryCollection, error)

func (*SqliteStore) GetPlayer

func (store *SqliteStore) GetPlayer(ctx context.Context, steamID steamid.SID64, player *model.Player) error

func (*SqliteStore) Init

func (store *SqliteStore) Init() error

func (*SqliteStore) LoadOrCreatePlayer

func (store *SqliteStore) LoadOrCreatePlayer(ctx context.Context, steamID steamid.SID64, player *model.Player) error

func (*SqliteStore) SaveMessage

func (store *SqliteStore) SaveMessage(ctx context.Context, message *model.UserMessage) error

func (*SqliteStore) SaveName

func (store *SqliteStore) SaveName(ctx context.Context, steamID steamid.SID64, name string) error

func (*SqliteStore) SavePlayer

func (store *SqliteStore) SavePlayer(ctx context.Context, state *model.Player) error

func (*SqliteStore) SearchPlayers

func (store *SqliteStore) SearchPlayers(ctx context.Context, opts model.SearchOpts) (model.PlayerCollection, error)

Jump to

Keyboard shortcuts

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