task

package
v0.0.0-...-481b1f5 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Copyright 2014 Google Inc. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to writing, software distributed under the License is distributed on a "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Task

type Task struct {
	ID    int64  // Unique identifier
	Title string // Description
	Done  bool   // Is this task done?
}

type TaskManager

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

TaskManager manages a list of tasks in a sql database.

func NewTaskManager

func NewTaskManager(driver, datasource string) (*TaskManager, error)

NewTaskManager returns a TaskManager with a sql database setup and configured.

func (*TaskManager) Delete

func (t *TaskManager) Delete(id int64) error

Delete deltes the Task with the given id in the database.

func (*TaskManager) Find

func (t *TaskManager) Find(id int64) (*Task, error)

Find returns the Task with the given id in the database.

func (*TaskManager) List

func (t *TaskManager) List() ([]*Task, error)

All returns the list of all the Tasks in the database.

func (*TaskManager) Save

func (t *TaskManager) Save(task *Task) error

Save saves the given Task in the database.

func (*TaskManager) Update

func (t *TaskManager) Update(task *Task) error

Update updates the given Task in the database.

Jump to

Keyboard shortcuts

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