api

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//Module di injector
	Module = application.Modules{
		NewAPI,
	}
	//Config di injector
	Config = application.Modules{}
)

Functions

This section is empty.

Types

type API

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

API model

func NewAPI

func NewAPI(route *routes.Router, repo *cache.Repository) *API

NewAPI init api

func (*API) CacheList

func (v *API) CacheList(w http.ResponseWriter, r *http.Request)

Index controller

func (*API) Down

func (v *API) Down() error

Down shutdown api service

func (*API) Up

func (v *API) Up() error

Up startup api service

type CacheList

type CacheList []CacheListItem

func (CacheList) MarshalEasyJSON

func (v CacheList) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (CacheList) MarshalJSON

func (v CacheList) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*CacheList) UnmarshalEasyJSON

func (v *CacheList) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*CacheList) UnmarshalJSON

func (v *CacheList) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type CacheListItem

type CacheListItem struct {
	Domain string   `json:"domain"`
	IP     []string `json:"ip"`
}

func (CacheListItem) MarshalEasyJSON

func (v CacheListItem) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (CacheListItem) MarshalJSON

func (v CacheListItem) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*CacheListItem) UnmarshalEasyJSON

func (v *CacheListItem) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*CacheListItem) UnmarshalJSON

func (v *CacheListItem) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

Jump to

Keyboard shortcuts

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