cocka2notesapi

package module
v1.0.19 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

README

Cocka2notes API for WebAssembly Note Taking Progressive Web Application

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	AddUser(u *User) *Response
	UpdateUser(u *User) *Response
	GetUser(email string) *User
	Login(u *User) *LoginResponse
	ResetPassword(u *User) *Response

	AddUserToNote(n *NoteUsers) *Response
	GetNoteUserList(noteID int64, ownerEmail string) *[]string

	AddNote(n *Note) *ResponseID
	UpdateNote(n *Note) *Response
	GetCheckboxNote(id int64) *CheckboxNote
	GetNote(id int64) *TextNote
	GetUsersNotes(email string) (*[]Note, bool)
	DeleteNote(id int64, ownerEmail string) *Response

	AddCheckboxItem(ni *CheckboxNoteItem) *ResponseID
	UpdateCheckboxItem(ni *CheckboxNoteItem) *Response
	DeleteCheckboxItem(id int64) *Response

	AddNoteItem(ni *NoteItem) *ResponseID
	UpdateNoteItem(ni *NoteItem) *Response
	DeleteNoteItem(id int64) *Response

	//Offline functionality below
	GetFailAddCheckboxNoteItemList() []CheckboxNoteItem
	GetFailUpdateCheckboxNoteItemList() []CheckboxNoteItem
	GetFailAddNoteItemList() []NoteItem
	GetFailUpdateNoteItemList() []NoteItem

	FlushFailedCache()

	SetNoteList(noteList []Note)
	GetNoteList() []Note
	// contains filtered or unexported methods
}

API API

type CheckboxNote

type CheckboxNote struct {
	ID         int64              `json:"id"`
	Title      string             `json:"title"`
	Type       string             `json:"type"`
	OwnerEmail string             `json:"ownerEmail"`
	NoteItems  []CheckboxNoteItem `json:"noteCheckboxItems"`
	LastUsed   time.Time          `json:"lastUsed"`
}

CheckboxNote CheckboxNote

type CheckboxNoteItem

type CheckboxNoteItem struct {
	ID      int64  `json:"id"`
	Text    string `json:"text"`
	Checked bool   `json:"checked"`
	NoteID  int64  `json:"noteId"`
}

CheckboxNoteItem CheckboxNoteItem

type Headers

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

Headers Headers

func (*Headers) Set

func (h *Headers) Set(key string, value string)

Set Set

type LoginResponse added in v1.0.3

type LoginResponse struct {
	Success bool   `json:"success"`
	Email   string `json:"email"`
}

LoginResponse LoginResponse

type MailServer added in v1.0.3

type MailServer struct {
	ID          int64  `json:"id"`
	Host        string `json:"host"`
	Username    string `json:"username"`
	Password    string `json:"password"`
	Port        string `json:"port"`
	SenderEmail string `json:"senderEmail"`
}

MailServer MailServer

type Note

type Note struct {
	ID                int64              `json:"id"`
	Title             string             `json:"title"`
	Type              string             `json:"type"`
	OwnerEmail        string             `json:"ownerEmail"`
	NoteTextItems     []NoteItem         `json:"noteTextItems"`
	NoteCheckboxItems []CheckboxNoteItem `json:"noteCheckboxItems"`
	LastUsed          time.Time          `json:"lastUsed"`
}

Note Note

type NoteItem

type NoteItem struct {
	ID     int64  `json:"id"`
	Text   string `json:"text"`
	NoteID int64  `json:"noteId"`
}

NoteItem NoteItem

type NoteUsers

type NoteUsers struct {
	OwnerEmail string `json:"ownerEmail"`
	NoteID     int64  `json:"noteId"`
	UserEmail  string `json:"userEmail"`
}

NoteUsers NoteUsers

type NotesAPI

type NotesAPI struct {
	FailAddCheckboxNoteItemList    []CheckboxNoteItem
	FailUpdateCheckboxNoteItemList []CheckboxNoteItem
	FailAddNoteItemList            []NoteItem
	FailUpdateNoteItemList         []NoteItem
	// contains filtered or unexported fields
}

NotesAPI NotesAPI

func (*NotesAPI) AddCheckboxItem

func (a *NotesAPI) AddCheckboxItem(ni *CheckboxNoteItem) *ResponseID

AddCheckboxItem AddCheckboxItem

func (*NotesAPI) AddNote

func (a *NotesAPI) AddNote(n *Note) *ResponseID

AddNote AddNote

func (*NotesAPI) AddNoteItem

func (a *NotesAPI) AddNoteItem(ni *NoteItem) *ResponseID

AddNoteItem AddNoteItem

func (*NotesAPI) AddUser

func (a *NotesAPI) AddUser(u *User) *Response

AddUser AddUser

func (*NotesAPI) AddUserToNote

func (a *NotesAPI) AddUserToNote(n *NoteUsers) *Response

AddUserToNote AddUserToNote

func (*NotesAPI) DeleteCheckboxItem

func (a *NotesAPI) DeleteCheckboxItem(id int64) *Response

DeleteCheckboxItem DeleteCheckboxItem

func (*NotesAPI) DeleteNote

func (a *NotesAPI) DeleteNote(id int64, ownerEmail string) *Response

DeleteNote DeleteNote

func (*NotesAPI) DeleteNoteItem

func (a *NotesAPI) DeleteNoteItem(id int64) *Response

DeleteNoteItem DeleteNoteItem

func (*NotesAPI) FlushFailedCache added in v1.0.16

func (a *NotesAPI) FlushFailedCache()

FlushFailedCache FlushFailedCache

func (*NotesAPI) GetCheckboxNote

func (a *NotesAPI) GetCheckboxNote(id int64) *CheckboxNote

GetCheckboxNote GetCheckboxNote

func (*NotesAPI) GetFailAddCheckboxNoteItemList added in v1.0.6

func (a *NotesAPI) GetFailAddCheckboxNoteItemList() []CheckboxNoteItem

GetFailAddCheckboxNoteItemList GetFailAddCheckboxNoteItemList

func (*NotesAPI) GetFailAddNoteItemList added in v1.0.6

func (a *NotesAPI) GetFailAddNoteItemList() []NoteItem

GetFailAddNoteItemList GetFailAddNoteItemList

func (*NotesAPI) GetFailUpdateCheckboxNoteItemList added in v1.0.6

func (a *NotesAPI) GetFailUpdateCheckboxNoteItemList() []CheckboxNoteItem

GetFailUpdateCheckboxNoteItemList GetFailUpdateCheckboxNoteItemList

func (*NotesAPI) GetFailUpdateNoteItemList added in v1.0.6

func (a *NotesAPI) GetFailUpdateNoteItemList() []NoteItem

GetFailUpdateNoteItemList GetFailUpdateNoteItemList

func (*NotesAPI) GetNew

func (a *NotesAPI) GetNew() API

GetNew GetNew

func (*NotesAPI) GetNote

func (a *NotesAPI) GetNote(id int64) *TextNote

GetNote GetNote

func (*NotesAPI) GetNoteList added in v1.0.15

func (a *NotesAPI) GetNoteList() []Note

GetNoteList GetNoteList

func (*NotesAPI) GetNoteUserList added in v1.0.1

func (a *NotesAPI) GetNoteUserList(noteID int64, ownerEmail string) *[]string

GetNoteUserList GetNoteUserList

func (*NotesAPI) GetUser added in v1.0.2

func (a *NotesAPI) GetUser(email string) *User

GetUser GetUser

func (*NotesAPI) GetUsersNotes

func (a *NotesAPI) GetUsersNotes(email string) (*[]Note, bool)

GetUsersNotes GetUsersNotes

func (*NotesAPI) Login added in v1.0.3

func (a *NotesAPI) Login(u *User) *LoginResponse

Login Login

func (*NotesAPI) OverrideProxy

func (a *NotesAPI) OverrideProxy(proxy px.Proxy)

OverrideProxy OverrideProxy

func (*NotesAPI) ResetPassword added in v1.0.4

func (a *NotesAPI) ResetPassword(u *User) *Response

ResetPassword ResetPassword

func (*NotesAPI) SetAPIKey

func (a *NotesAPI) SetAPIKey(key string)

SetAPIKey SetAPIKey

func (*NotesAPI) SetHeader

func (a *NotesAPI) SetHeader(head *Headers)

SetHeader SetHeader

func (*NotesAPI) SetLogLevel

func (a *NotesAPI) SetLogLevel(level int)

SetLogLevel SetLogLevel

func (*NotesAPI) SetLogger

func (a *NotesAPI) SetLogger(l *lg.Logger)

SetLogger SetLogger

func (*NotesAPI) SetNoteList added in v1.0.9

func (a *NotesAPI) SetNoteList(noteList []Note)

SetNoteList SetNoteList

func (*NotesAPI) SetRestURL

func (a *NotesAPI) SetRestURL(url string)

SetRestURL SetRestURL

func (*NotesAPI) UpdateCheckboxItem

func (a *NotesAPI) UpdateCheckboxItem(ni *CheckboxNoteItem) *Response

UpdateCheckboxItem UpdateCheckboxItem

func (*NotesAPI) UpdateNote

func (a *NotesAPI) UpdateNote(n *Note) *Response

UpdateNote UpdateNote

func (*NotesAPI) UpdateNoteItem

func (a *NotesAPI) UpdateNoteItem(ni *NoteItem) *Response

UpdateNoteItem UpdateNoteItem

func (*NotesAPI) UpdateUser

func (a *NotesAPI) UpdateUser(u *User) *Response

UpdateUser UpdateUser

type Response

type Response struct {
	Success bool   `json:"success"`
	Code    int64  `json:"code"`
	Message string `json:"message"`
}

Response Response

type ResponseID

type ResponseID struct {
	ID      int64  `json:"id"`
	Success bool   `json:"success"`
	Code    int64  `json:"code"`
	Message string `json:"message"`
}

ResponseID ResponseID

type TextNote added in v1.0.9

type TextNote struct {
	ID         int64      `json:"id"`
	Title      string     `json:"title"`
	Type       string     `json:"type"`
	OwnerEmail string     `json:"ownerEmail"`
	NoteItems  []NoteItem `json:"noteTextItems"`
	LastUsed   time.Time  `json:"lastUsed"`
}

TextNote TextNote

type User

type User struct {
	Email      string `json:"email"`
	Password   string `json:"password"`
	WebEnabled bool   `json:"webEnabled"`
}

User User

Jump to

Keyboard shortcuts

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