hackernews

package
v0.0.0-...-4d6a655 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(addr string) (*client, error)

Types

type Client

type Client interface {
	FetchAll(ctx context.Context) ([]models.Item, error)
	FetchStories(ctx context.Context) ([]models.Item, error)
	FetchJobs(ctx context.Context) ([]models.Item, error)
}

Client is a interface to expose methods to interact the internal hacker news api

type Mock

type Mock struct {
	mock.Mock
}

func (*Mock) FetchAll

func (m *Mock) FetchAll(ctx context.Context) ([]models.Item, error)

func (*Mock) FetchJobs

func (m *Mock) FetchJobs(ctx context.Context) ([]models.Item, error)

func (*Mock) FetchStories

func (m *Mock) FetchStories(ctx context.Context) ([]models.Item, error)

Jump to

Keyboard shortcuts

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