book

package
v0.0.0-...-aa5133b Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddReq

type AddReq struct {
	Username string
	Token    string
	Book     Book
}

type Book

type Book struct {
	ID     int64
	Title  string
	Author string
}

type BookService

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

func (BookService) Add

func (s BookService) Add(req *AddReq, res *int64) error

func (BookService) List

func (s BookService) List(req *ListReq, res *[]Book) error

type Client

type Client interface {
	Add(username string, token string, b Book) (int64, error)
	List(username string, token string) ([]Book, error)
}

func NewClient

func NewClient(ctx context.Context, url string, name string) Client

type ListReq

type ListReq struct {
	Username string
	Token    string
}

type Repository

type Repository interface {
	Insert(username string, b Book) (int64, error)
	Select(username string) ([]Book, error)
}

func NewSQLiteRepository

func NewSQLiteRepository(urn string) (Repository, error)

type Service

type Service interface {
	Add(req *AddReq, res *int64) error
	List(req *ListReq, res *[]Book) error
}

func NewService

func NewService(r Repository, c auth.Client) Service

Jump to

Keyboard shortcuts

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