datastores

package
v0.0.0-...-4136aea Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Datastore

type Datastore interface {
	ListTodos() types.Todos
	FindTodo(id string) types.Todo
	CreateTodo(t types.Todo) types.Todo
	DestroyTodo(id string) error
}

type GoogleCloudStorer

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

func NewGoogleCloudStorer

func NewGoogleCloudStorer(projectID string, bucketName string, ctx context.Context) *GoogleCloudStorer

func (*GoogleCloudStorer) CreateTodo

func (s *GoogleCloudStorer) CreateTodo(t types.Todo) types.Todo

CreateTodo stores a new Todo in Google Cloud Storage

func (*GoogleCloudStorer) DestroyTodo

func (s *GoogleCloudStorer) DestroyTodo(id string) error

DestroyTodo removes a Todo from Google Cloud Storage

func (*GoogleCloudStorer) FindTodo

func (s *GoogleCloudStorer) FindTodo(id string) types.Todo

FindTodo retrieves a Todo obj from Google Cloud Storage if it exists. If it doesn't, the method will return an empty Todo

func (*GoogleCloudStorer) ListTodos

func (s *GoogleCloudStorer) ListTodos() types.Todos

type InMemoryStorer

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

func NewInMemoryStorer

func NewInMemoryStorer() *InMemoryStorer

func (*InMemoryStorer) CreateTodo

func (s *InMemoryStorer) CreateTodo(t types.Todo) types.Todo

func (*InMemoryStorer) DestroyTodo

func (s *InMemoryStorer) DestroyTodo(id string) error

func (*InMemoryStorer) FindTodo

func (s *InMemoryStorer) FindTodo(id string) types.Todo

func (*InMemoryStorer) ListTodos

func (s *InMemoryStorer) ListTodos() types.Todos

Jump to

Keyboard shortcuts

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