storage

package
v0.0.0-...-e66e247 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContentTypeJson = "application/json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateTaskRequest

type CreateTaskRequest struct {
	Name     string    `json:"name"`
	Body     string    `json:"body"`
	Deadline time.Time `json:"deadline"`
}

type CreateTaskResponse

type CreateTaskResponse struct {
	Uuid string `json:"uuid"`
}

type DeleteTaskRequest

type DeleteTaskRequest struct {
	Uuid string `json:"uuid"`
}

type DeleteTaskResponse

type DeleteTaskResponse OkResponse

type ErrResponse

type ErrResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type GetTaskRequest

type GetTaskRequest struct {
	Uuid string `json:"uuid"`
}

type GetTaskResponse

type GetTaskResponse Task

type ListTaskRequest

type ListTaskRequest struct {
}

type ListTaskResponse

type ListTaskResponse struct {
	List []Task `json:"list"`
}

type OkResponse

type OkResponse struct {
	Code int `json:"code"`
}

type Storage

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

func New

func New(url string) Storage

func (*Storage) CreateTask

func (s *Storage) CreateTask(name, body string, deadline time.Time) (string, error)

func (*Storage) DeleteTask

func (s *Storage) DeleteTask(uuid string) error

func (*Storage) GetListTask

func (s *Storage) GetListTask() (ListTaskResponse, error)

func (*Storage) GetTask

func (s *Storage) GetTask(uuid string) (Task, error)

func (*Storage) UpdateTask

func (s *Storage) UpdateTask(uuid string, name, body *string, status *bool, deadline *time.Time) error

type Task

type Task struct {
	Uuid     string    `json:"uuid"`
	Name     string    `json:"name"`
	Body     string    `json:"body"`
	Status   bool      `json:"status"`
	Deadline time.Time `json:"deadline"`
}

type UpdateTaskRequest

type UpdateTaskRequest struct {
	Uuid     string     `json:"uuid"`
	Name     *string    `json:"name"`
	Body     *string    `json:"body"`
	Status   *bool      `json:"status"`
	Deadline *time.Time `json:"deadline"`
}

type UpdateTaskResponse

type UpdateTaskResponse OkResponse

Jump to

Keyboard shortcuts

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