services

package
v0.0.2-0...-d9a3ee1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Now = time.Now

Functions

This section is empty.

Types

type Option

type Option func(service *ToDoService)

func WithCache

func WithCache(cache cache.Cache) Option

func WithConfig

func WithConfig(cfg *config.Config) Option

func WithStore

func WithStore(db storages.StoreInterface) Option

type ToDoService

type ToDoService struct {
	Store storages.StoreInterface
	Cache cache.Cache
	// contains filtered or unexported fields
}

ToDoService implement HTTserver

func NewToDoService

func NewToDoService(opts ...Option) *ToDoService

func (*ToDoService) AddTask

func (s *ToDoService) AddTask(ctx context.Context, userID, content string) (*storages.Task, error)

func (*ToDoService) ListTasks

func (s *ToDoService) ListTasks(ctx context.Context, userID, createDate string) ([]*storages.Task, error)

func (*ToDoService) Login

func (s *ToDoService) Login(ctx context.Context, userID, pw string, jwtKey string) (string, error)

func (*ToDoService) ValidToken

func (s *ToDoService) ValidToken(token, jwtKey string) (string, error)

Jump to

Keyboard shortcuts

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