db

package
v0.0.0-...-6b8cf79 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	Open() error

	InsertUser(name, password string) error
	SelectUser(name string) (UserRecord, error)

	CreateSession() (string, error)
	GetSession(id string) (bool, error)
}

func NewSqliteStore

func NewSqliteStore(filename string) Database

type SqliteStore

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

func (*SqliteStore) CreateSession

func (s *SqliteStore) CreateSession() (string, error)

func (*SqliteStore) GetSession

func (s *SqliteStore) GetSession(id string) (bool, error)

func (*SqliteStore) InsertUser

func (s *SqliteStore) InsertUser(name, password string) error

func (*SqliteStore) Open

func (s *SqliteStore) Open() error

func (*SqliteStore) SelectUser

func (s *SqliteStore) SelectUser(name string) (UserRecord, error)

type UserRecord

type UserRecord struct {
	ID       string
	Name     string
	Password string
}

Jump to

Keyboard shortcuts

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