jsonplaceholder

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Post

type Post struct {
	UserID int    `json:"userId"`
	ID     int    `json:"id"`
	Title  string `json:"title"`
	Body   string `json:"body"`
}

Post a post entry

type PostImpl

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

PostImpl implements the PostService interface

func (*PostImpl) Create

func (p *PostImpl) Create(ctx context.Context, newPost *Post) (*Post, *http.Response, error)

Create a new post

func (*PostImpl) Delete

func (p *PostImpl) Delete(ctx context.Context, id int) (*http.Response, error)

Delete a post by ID

func (*PostImpl) Get

func (p *PostImpl) Get(ctx context.Context, id int) (*Post, *http.Response, error)

Get a post by ID

func (*PostImpl) List

func (p *PostImpl) List(ctx context.Context) ([]Post, *http.Response, error)

List all posts

type PostService

type PostService interface {
	Get(context.Context, int) (*Post, *http.Response, error)
	List(context.Context) ([]Post, *http.Response, error)
	Create(context.Context, *Post) (*Post, *http.Response, error)
	Delete(context.Context, int) (*http.Response, error)
}

PostService interface defines service methods

Jump to

Keyboard shortcuts

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