database

package
v0.0.0-...-20ea542 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 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 {
	Client    *firestore.Client
	Ctx       context.Context
	ProjectID string
}

func NewDB

func NewDB(projectID string, ctx context.Context) (*DB, error)

func (*DB) AddTodoItem

func (db *DB) AddTodoItem(name, description string, completed bool) (string, error)

func (*DB) GetTodoList

func (db *DB) GetTodoList(name string) (*[]TodoItem, error)

func (*DB) RemoveTodoItem

func (db *DB) RemoveTodoItem(id string) (string, error)

func (*DB) SetTodoItem

func (db *DB) SetTodoItem(id string, description string, completed bool) (string, error)

type TodoItem

type TodoItem struct {
	ID          string `firestore:"id,omitempty"`
	Name        string `firestore:"name"`
	Description string `firestore:"description"`
	Completed   bool   `firestore:"completed"`
	Timestamp   int64  `firestore:"timestamp"`
}

Jump to

Keyboard shortcuts

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