test

package
v0.0.0-...-ee3211a Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2022 License: AGPL-3.0 Imports: 15 Imported by: 0

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