fetchuser

package module
v0.0.0-...-f03be7a Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package fetchuser is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIFetcher

type APIFetcher interface {
	FetchData(id int) (User, error)
}

type FetchDataFunc

type FetchDataFunc func(url string, id int) (User, error)

type MockAPIFetcher

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

MockAPIFetcher is a mock of APIFetcher interface.

func NewMockAPIFetcher

func NewMockAPIFetcher(ctrl *gomock.Controller) *MockAPIFetcher

NewMockAPIFetcher creates a new mock instance.

func (*MockAPIFetcher) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockAPIFetcher) FetchData

func (m *MockAPIFetcher) FetchData(id int) (User, error)

FetchData mocks base method.

type MockAPIFetcherMockRecorder

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

MockAPIFetcherMockRecorder is the mock recorder for MockAPIFetcher.

func (*MockAPIFetcherMockRecorder) FetchData

func (mr *MockAPIFetcherMockRecorder) FetchData(id interface{}) *gomock.Call

FetchData indicates an expected call of FetchData.

type RealAPIFetcher

type RealAPIFetcher struct {
	ApiURL string
}

func (*RealAPIFetcher) FetchData

func (ra *RealAPIFetcher) FetchData(id int) (User, error)

type User

type User struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

func ProcessUser

func ProcessUser(fetcher APIFetcher, id int) (User, error)

func ProcessUserHOF

func ProcessUserHOF(fetchData FetchDataFunc, url string, id int) (User, error)

func RealFetchData

func RealFetchData(url string, id int) (User, error)

Jump to

Keyboard shortcuts

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