cocka2db

package
v0.0.0-...-37e23a2 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2021 License: GPL-3.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 C2DB

type C2DB struct {
	DB  dbi.Database
	Log *lg.Logger
}

C2DB C2DB

func (*C2DB) AddCheckboxItem

func (c *C2DB) AddCheckboxItem(ni *CheckboxNoteItem) (bool, int64)

AddCheckboxItem AddCheckboxItem

func (*C2DB) AddNote

func (c *C2DB) AddNote(n *Note) (bool, int64)

AddNote AddNote

func (*C2DB) AddNoteItem

func (c *C2DB) AddNoteItem(ni *NoteItem) (bool, int64)

AddNoteItem AddNoteItem

func (*C2DB) AddNoteUser

func (c *C2DB) AddNoteUser(nu *NoteUsers) bool

AddNoteUser AddNoteUser

func (*C2DB) AddUser

func (c *C2DB) AddUser(u *User) bool

AddUser AddUser

func (*C2DB) DeleteCheckboxItem

func (c *C2DB) DeleteCheckboxItem(id int64) bool

DeleteCheckboxItem DeleteCheckboxItem

func (*C2DB) DeleteNote

func (c *C2DB) DeleteNote(id int64) bool

DeleteNote DeleteNote

func (*C2DB) DeleteNoteItem

func (c *C2DB) DeleteNoteItem(id int64) bool

DeleteNoteItem DeleteNoteItem

func (*C2DB) DeleteNoteUser

func (c *C2DB) DeleteNoteUser(nu *NoteUsers) bool

DeleteNoteUser DeleteNoteUser

func (*C2DB) DeleteUser

func (c *C2DB) DeleteUser(email string) bool

DeleteUser DeleteUser

func (*C2DB) GetCheckboxItemList

func (c *C2DB) GetCheckboxItemList(noteID int64) *[]CheckboxNoteItem

GetCheckboxItemList GetCheckboxItemList

func (*C2DB) GetMailServerInfo

func (c *C2DB) GetMailServerInfo() *MailServer

GetMailServerInfo GetMailServerInfo

func (*C2DB) GetNew

func (c *C2DB) GetNew() NotesDB

GetNew GetNew

func (*C2DB) GetNote

func (c *C2DB) GetNote(id int64) *Note

GetNote GetNote

func (*C2DB) GetNoteItemList

func (c *C2DB) GetNoteItemList(noteID int64) *[]NoteItem

GetNoteItemList GetNoteItemList

func (*C2DB) GetNoteUserList

func (c *C2DB) GetNoteUserList(noteID int64, ownerEmail string) *[]string

GetNoteUserList GetNoteUserList

func (*C2DB) GetUser

func (c *C2DB) GetUser(email string) *User

GetUser GetUser

func (*C2DB) GetUsersNotes

func (c *C2DB) GetUsersNotes(email string) *[]Note

GetUsersNotes GetUsersNotes

func (*C2DB) UpdateCheckboxItem

func (c *C2DB) UpdateCheckboxItem(ni *CheckboxNoteItem) bool

UpdateCheckboxItem UpdateCheckboxItem

func (*C2DB) UpdateNote

func (c *C2DB) UpdateNote(n *Note) bool

UpdateNote UpdateNote

func (*C2DB) UpdateNoteItem

func (c *C2DB) UpdateNoteItem(ni *NoteItem) bool

UpdateNoteItem UpdateNoteItem

func (*C2DB) UpdateUser

func (c *C2DB) UpdateUser(u *User) bool

UpdateUser UpdateUser

type CheckboxNoteItem

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

CheckboxNoteItem CheckboxNoteItem

type MailServer

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 MockC2DB

type MockC2DB struct {
	DB  dbi.Database
	Log *lg.Logger

	MockAddUserSuc    bool
	MockUpdateUserSuc bool
	MockUser          *User
	MockDeleteUserSuc bool

	MockAddNoteSuc    bool
	MockAddNoteID     int64
	MockUpdateNoteSuc bool
	MockNote          *Note
	MockNoteList      *[]Note
	MockDeleteNoteSuc bool

	MockAddNoteItemSuc    bool
	MockNoteItemID        int64
	MockUpdateNoteItemSuc bool
	MockNoteItemList      *[]NoteItem
	MockDeleteNoteItemSuc bool

	MockAddCheckboxNoteItemSuc    bool
	MockCheckboxNoteItemID        int64
	MockUpdateCheckboxNoteItemSuc bool
	MockCheckboxNoteItemList      *[]CheckboxNoteItem
	MockDeleteCheckboxNoteItemSuc bool

	MockAddNoteUserSuc    bool
	MockDeleteNoteUserSuc bool
	MockNoteUserList      *[]string

	MockMailServer *MailServer
}

MockC2DB MockC2DB

func (*MockC2DB) AddCheckboxItem

func (c *MockC2DB) AddCheckboxItem(ni *CheckboxNoteItem) (bool, int64)

AddCheckboxItem AddCheckboxItem

func (*MockC2DB) AddNote

func (c *MockC2DB) AddNote(n *Note) (bool, int64)

AddNote AddNote

func (*MockC2DB) AddNoteItem

func (c *MockC2DB) AddNoteItem(ni *NoteItem) (bool, int64)

AddNoteItem AddNoteItem

func (*MockC2DB) AddNoteUser

func (c *MockC2DB) AddNoteUser(nu *NoteUsers) bool

AddNoteUser AddNoteUser

func (*MockC2DB) AddUser

func (c *MockC2DB) AddUser(u *User) bool

AddUser AddUser

func (*MockC2DB) DeleteCheckboxItem

func (c *MockC2DB) DeleteCheckboxItem(id int64) bool

DeleteCheckboxItem DeleteCheckboxItem

func (*MockC2DB) DeleteNote

func (c *MockC2DB) DeleteNote(id int64) bool

DeleteNote DeleteNote

func (*MockC2DB) DeleteNoteItem

func (c *MockC2DB) DeleteNoteItem(id int64) bool

DeleteNoteItem DeleteNoteItem

func (*MockC2DB) DeleteNoteUser

func (c *MockC2DB) DeleteNoteUser(nu *NoteUsers) bool

DeleteNoteUser DeleteNoteUser

func (*MockC2DB) DeleteUser

func (c *MockC2DB) DeleteUser(email string) bool

DeleteUser DeleteUser

func (*MockC2DB) GetCheckboxItemList

func (c *MockC2DB) GetCheckboxItemList(noteID int64) *[]CheckboxNoteItem

GetCheckboxItemList GetCheckboxItemList

func (*MockC2DB) GetMailServerInfo

func (c *MockC2DB) GetMailServerInfo() *MailServer

GetMailServerInfo GetMailServerInfo

func (*MockC2DB) GetNew

func (c *MockC2DB) GetNew() NotesDB

GetNew GetNew

func (*MockC2DB) GetNote

func (c *MockC2DB) GetNote(id int64) *Note

GetNote GetNote

func (*MockC2DB) GetNoteItemList

func (c *MockC2DB) GetNoteItemList(noteID int64) *[]NoteItem

GetNoteItemList GetNoteItemList

func (*MockC2DB) GetNoteUserList

func (c *MockC2DB) GetNoteUserList(noteID int64, ownerEmail string) *[]string

GetNoteUserList GetNoteUserList

func (*MockC2DB) GetUser

func (c *MockC2DB) GetUser(email string) *User

GetUser GetUser

func (*MockC2DB) GetUsersNotes

func (c *MockC2DB) GetUsersNotes(email string) *[]Note

GetUsersNotes GetUsersNotes

func (*MockC2DB) UpdateCheckboxItem

func (c *MockC2DB) UpdateCheckboxItem(ni *CheckboxNoteItem) bool

UpdateCheckboxItem UpdateCheckboxItem

func (*MockC2DB) UpdateNote

func (c *MockC2DB) UpdateNote(n *Note) bool

UpdateNote UpdateNote

func (*MockC2DB) UpdateNoteItem

func (c *MockC2DB) UpdateNoteItem(ni *NoteItem) bool

UpdateNoteItem UpdateNoteItem

func (*MockC2DB) UpdateUser

func (c *MockC2DB) UpdateUser(u *User) bool

UpdateUser UpdateUser

type Note

type Note struct {
	ID         int64     `json:"id"`
	Title      string    `json:"title"`
	Type       string    `json:"type"`
	OwnerEmail string    `json:"ownerEmail"`
	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 {
	UserEmail string `json:"userEmail"`
	NoteID    int64  `json:"noteId"`
}

NoteUsers NoteUsers

type NotesDB

type NotesDB interface {
	AddUser(u *User) bool
	UpdateUser(u *User) bool
	GetUser(email string) *User
	DeleteUser(email string) bool

	AddNote(n *Note) (bool, int64)
	UpdateNote(n *Note) bool
	GetNote(id int64) *Note
	GetUsersNotes(email string) *[]Note
	DeleteNote(id int64) bool

	AddCheckboxItem(ni *CheckboxNoteItem) (bool, int64)
	UpdateCheckboxItem(ni *CheckboxNoteItem) bool
	// //GetCheckboxItem(id int64) *CheckboxNoteItem
	GetCheckboxItemList(noteID int64) *[]CheckboxNoteItem
	DeleteCheckboxItem(id int64) bool

	AddNoteItem(ni *NoteItem) (bool, int64)
	UpdateNoteItem(ni *NoteItem) bool
	// //GetNoteItem(id int64) *NoteItem
	GetNoteItemList(noteID int64) *[]NoteItem
	GetNoteUserList(noteID int64, ownerEmail string) *[]string
	DeleteNoteItem(id int64) bool

	AddNoteUser(nu *NoteUsers) bool
	DeleteNoteUser(nu *NoteUsers) bool

	GetMailServerInfo() *MailServer
}

NotesDB NotesDB

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