swapi

package
v0.0.0-...-6452c0a Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2022 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package swapi is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func (*Client) Film

func (c *Client) Film(id int) (RespFilm, error)

func (*Client) Planet

func (c *Client) Planet(id int) (RespPlanet, error)

type MockSWAPI

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

MockSWAPI is a mock of SWAPI interface.

func NewMockSWAPI

func NewMockSWAPI(ctrl *gomock.Controller) *MockSWAPI

NewMockSWAPI creates a new mock instance.

func (*MockSWAPI) EXPECT

func (m *MockSWAPI) EXPECT() *MockSWAPIMockRecorder

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

func (*MockSWAPI) Film

func (m *MockSWAPI) Film(id int) (RespFilm, error)

Film mocks base method.

func (*MockSWAPI) Planet

func (m *MockSWAPI) Planet(id int) (RespPlanet, error)

Planet mocks base method.

type MockSWAPIMockRecorder

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

MockSWAPIMockRecorder is the mock recorder for MockSWAPI.

func (*MockSWAPIMockRecorder) Film

func (mr *MockSWAPIMockRecorder) Film(id interface{}) *gomock.Call

Film indicates an expected call of Film.

func (*MockSWAPIMockRecorder) Planet

func (mr *MockSWAPIMockRecorder) Planet(id interface{}) *gomock.Call

Planet indicates an expected call of Planet.

type Option

type Option func(*Client)

type RespFilm

type RespFilm struct {
	Title         string   `json:"title"`
	EpisodeID     int      `json:"episode_id"`
	OpeningCrawl  string   `json:"opening_crawl"`
	Director      string   `json:"director"`
	Producer      string   `json:"producer"`
	CharacterURLs []string `json:"characters"`
	PlanetURLs    []string `json:"planets"`
	StarshipURLs  []string `json:"starships"`
	VehicleURLs   []string `json:"vehicles"`
	SpeciesURLs   []string `json:"species"`
	Created       string   `json:"created"`
	Edited        string   `json:"edited"`
	ReleaseDate   string   `json:"release_date"`
	URL           string   `json:"url"`
}

type RespPlanet

type RespPlanet struct {
	Name           string   `json:"name"`
	RotationPeriod string   `json:"rotation_period"`
	OrbitalPeriod  string   `json:"orbital_period"`
	Diameter       string   `json:"diameter"`
	Climate        string   `json:"climate"`
	Gravity        string   `json:"gravity"`
	Terrain        string   `json:"terrain"`
	SurfaceWater   string   `json:"surface_water"`
	Population     string   `json:"population"`
	ResidentURLs   []string `json:"residents"`
	FilmURLs       []string `json:"films"`
	Created        string   `json:"created"`
	Edited         string   `json:"edited"`
	URL            string   `json:"url"`
}

type SWAPI

type SWAPI interface {
	Planet(id int) (RespPlanet, error)
	Film(id int) (RespFilm, error)
}

func NewClient

func NewClient(options ...Option) SWAPI

Jump to

Keyboard shortcuts

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