poem

package
v0.0.0-...-2eb6bad Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnifyRequestHostHook

func UnifyRequestHostHook(url *url.URL) string

func UnifyRequestURIHook

func UnifyRequestURIHook(url *url.URL) string

Types

type Client

type Client interface {
	GetRandomPoem(ctx context.Context) (*Poem, error)
}

func NewClient

func NewClient(host, apiKey string) Client

type ClientImpl

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

func (*ClientImpl) GetRandomPoem

func (c *ClientImpl) GetRandomPoem(ctx context.Context) (*Poem, error)

type Data

type Data struct {
	ID                string   `json:"id"`
	Content           string   `json:"content"`
	Popularity        int      `json:"popularity"`
	Origin            *Origin  `json:"origin"`
	MatchTags         []string `json:"matchTags"`
	RecommendedReason string   `json:"recommendedReason"`
	CacheAt           string   `json:"cacheAt"`
}

type Origin

type Origin struct {
	Title     string      `json:"title"`
	Dynasty   string      `json:"dynasty"`
	Author    string      `json:"author"`
	Content   []string    `json:"content"`
	Translate interface{} `json:"translate"`
}

type Poem

type Poem struct {
	Status    string      `json:"status"`
	Data      *Data       `json:"data"`
	Token     string      `json:"token"`
	IPAddress string      `json:"ipAddress"`
	Warning   interface{} `json:"warning"`
}

Jump to

Keyboard shortcuts

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