storage

package
v0.0.0-...-cd93cf5 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found requested data")
View Source
var ErrTooMuchShares = errors.New("too much shares")

Functions

This section is empty.

Types

type Session

type Session struct {
	GithubUserID uint64
	SessionID    [32]byte
}

type Share

type Share struct {
	GithubUserID uint64
	Path         string
	Chart        []byte
}

type SqliteStorage

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

func NewSqliteStorage

func NewSqliteStorage(path string) (SqliteStorage, error)

func (*SqliteStorage) CreateShare

func (d *SqliteStorage) CreateShare(share *Share, maxSharesPerUser int) (bool, error)

func (*SqliteStorage) GetShare

func (d *SqliteStorage) GetShare(path string) (*Share, error)

func (*SqliteStorage) GetUserShares

func (d *SqliteStorage) GetUserShares(githubUserID uint64) ([]Share, error)

func (*SqliteStorage) IsPathAvail

func (d *SqliteStorage) IsPathAvail(path string) (bool, error)

func (*SqliteStorage) IsSessionValid

func (d *SqliteStorage) IsSessionValid(s *Session) error

func (*SqliteStorage) RemoveSession

func (d *SqliteStorage) RemoveSession(s *Session) error

func (*SqliteStorage) RemoveShare

func (d *SqliteStorage) RemoveShare(path string, githubUserID uint64) error

func (*SqliteStorage) StoreSession

func (d *SqliteStorage) StoreSession(s *Session) error

Jump to

Keyboard shortcuts

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