test

package
v0.0.0-...-77910ac Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2025 License: AGPL-3.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertDeepEqual

func AssertDeepEqual[T any](t testing.TB, got, want T)

func AuthorizeFor

func AuthorizeFor(t testing.TB, server *server.Server, notebook, password string) string

func DecodeJson

func DecodeJson[T any](t testing.TB, res *httptest.ResponseRecorder) T

func DeleteAPIRequest

func DeleteAPIRequest(t testing.TB, path string) *http.Request

func EncodeJson

func EncodeJson[T any](t testing.TB, got T) string

func GetAPIRequest

func GetAPIRequest(t testing.TB, path string) *http.Request

func HashWithDefault

func HashWithDefault(password string) string

func PostAPIRequest

func PostAPIRequest(t testing.TB, path string, body string, headers http.Header) *http.Request

func PutAPIRequest

func PutAPIRequest(t testing.TB, path string, body string, headers http.Header) *http.Request

func ValidateWith

func ValidateWith(notebook string, token []byte, issuerKey string) bool

Types

type StubServerStore

type StubServerStore struct {
	Notebooks map[string]model.Notebook
	Notes     map[string]model.Note
}

func NewStubServerStore

func NewStubServerStore() *StubServerStore

func (*StubServerStore) CreateNote

func (store *StubServerStore) CreateNote(data *model.Note) error

func (*StubServerStore) CreateNotebook

func (store *StubServerStore) CreateNotebook(id string, name string, protection auth.ProtectionLevel, hash string) error

func (*StubServerStore) DeleteNote

func (store *StubServerStore) DeleteNote(id string) error

func (*StubServerStore) DeleteNotebook

func (store *StubServerStore) DeleteNotebook(id string) error

func (*StubServerStore) GetNote

func (store *StubServerStore) GetNote(id string) (*model.Note, error)

func (*StubServerStore) GetNoteByOrder

func (store *StubServerStore) GetNoteByOrder(notebook string, order uint) (*model.Note, error)

func (*StubServerStore) GetNotebook

func (store *StubServerStore) GetNotebook(id string) (*model.Notebook, error)

func (*StubServerStore) GetNotesByNotebook

func (store *StubServerStore) GetNotesByNotebook(id string) ([]model.Note, error)

func (*StubServerStore) NoteCount

func (store *StubServerStore) NoteCount(notebook string) uint

func (*StubServerStore) UpdateNote

func (store *StubServerStore) UpdateNote(data *model.Note) (model.Note, error)

Jump to

Keyboard shortcuts

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