storage

package
v0.0.0-...-f115076 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

func NewDB

func NewDB() *DB

func (*DB) AddOrAuthUser

func (s *DB) AddOrAuthUser(name, password string) error

AddUser adds a user to the storage if it is not already there.

func (*DB) AddOrEditNote

func (s *DB) AddOrEditNote(user string, n Note)

func (*DB) DelSession

func (s *DB) DelSession(user string)

func (*DB) GetNotes

func (s *DB) GetNotes(user string) []Note

func (*DB) GetToken

func (s *DB) GetToken(user string) (token string)

func (*DB) GetUser

func (s *DB) GetUser(token string) (user string, valid bool)

func (*DB) HasUser

func (s *DB) HasUser(name string) bool

HasUser checks if the user exists.

type Note

type Note struct {
	Title, Text string
}

Jump to

Keyboard shortcuts

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