api

package
v0.0.0-...-54f910c Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeApiHandler

func MakeApiHandler(config *config.ProxyConfig) func()

Types

type ApiService

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

func NewApiService

func NewApiService(c *config.ProxyConfig) *ApiService

func (*ApiService) BlockListAdd

func (s *ApiService) BlockListAdd(r *http.Request, req *BlockListAddReq, res *Empty) error

func (*ApiService) BlockListCount

func (s *ApiService) BlockListCount(r *http.Request, req *Empty, res *BlockListCountRes) error

func (*ApiService) BlockListDelete

func (s *ApiService) BlockListDelete(r *http.Request, req *BlockListDeleteReq, res *BlockListDeleteRes) error

func (*ApiService) CacheAdd

func (s *ApiService) CacheAdd(r *http.Request, req *CacheAddReq, res *Empty) error

func (*ApiService) CacheDebug

func (s *ApiService) CacheDebug(r *http.Request, req *Empty, res *CacheDebugRes) error

func (*ApiService) CacheDelete

func (s *ApiService) CacheDelete(r *http.Request, req *CacheDeleteReq, res *Empty) error

func (*ApiService) Config

func (s *ApiService) Config(r *http.Request, req *Empty, res *config.UserConfig) error

type BlockListAddReq

type BlockListAddReq struct {
	Entries []string `json:"entries"`
}

type BlockListCountRes

type BlockListCountRes struct {
	Count int `json:"count"`
}

type BlockListDeleteReq

type BlockListDeleteReq struct {
	Name string `json:"name"`
}

type BlockListDeleteRes

type BlockListDeleteRes struct {
	Found bool `json:"found"`
}

type CacheAddReq

type CacheAddReq struct {
	RR        string `json:"rr"`
	Permanent bool   `json:"permanent"`
	Ptr       bool   `json:"ptr"`
}

type CacheDebugRes

type CacheDebugRes struct {
	Entries []string `json:"entries"`
}

type CacheDeleteReq

type CacheDeleteReq struct {
	Name  string `json:"name"`
	Qtype string `json:"qtype"`
	Ptr   bool   `json:"ptr"`
}

type Empty

type Empty struct{}

Jump to

Keyboard shortcuts

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