server

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

@title Kincong Resolver Rest Server @version debug @description API для получения подсетей на основе IP адресов, доменов и ASN @host localhost @schemes http @BasePath /

type ResolveRequest

type ResolveRequest struct {
	// Список IP адресов для разрешения
	IPs []string `json:"ip,omitempty" example:"8.8.8.8"`
	// Список доменных имен для разрешения
	Domains []string `json:"domain,omitempty" example:"google.com"`
	// Список ASN для разрешения
	ASNs []string `json:"asn,omitempty" example:"AS12345"`
}

func (*ResolveRequest) Values

func (r *ResolveRequest) Values() []utils.Value

type ResolveResponse

type ResolveResponse web.Response[ResolveResponseData]

type ResolveResponseData

type ResolveResponseData map[utils.Value][]utils.ResolvedSubnet

type ResponseError

type ResponseError web.Response[string]

type Server

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

func New

func New(revision string, baseURL *url.URL, resolver *resolver.Resolver, tmpl *template.Template) *Server

func (*Server) Start

func (s *Server) Start(cancel context.CancelCauseFunc, port int)

func (*Server) Stop

func (s *Server) Stop(ctx context.Context)

type Value

type Value struct {
	Input  string `json:"input"`
	Type   string `json:"type"`
	Output string `json:"output"`
}

type ValueRequest

type ValueRequest struct {
	Value utils.Value `json:"value" example:"google.com"`
}

type ValueResponse

type ValueResponse web.Response[ValueResponseData]

type ValueResponseData

type ValueResponseData resolver.InfoResult

type ValueSearchItem

type ValueSearchItem struct {
	// From - Источник данных, например "example.com"
	From string `json:"from" example:"example.com"`

	// Value - Значение, например
	//
	// Для типа:
	// asn - AS12345
	// cidr - 192.168.0.0/24
	// ip - 192.168.0.1
	Value string `json:"value" example:"AS12345"`

	Type ValueSearchItemType `json:"type" example:"asn"`
}

ValueSearchItem - Элемент результата поиска значений

type ValueSearchItemType

type ValueSearchItemType string

ValueSearchItemType - Тип для value

const (
	ASN  ValueSearchItemType = "asn"
	CIDR ValueSearchItemType = "cidr"
	IP   ValueSearchItemType = "ip"
)

type ValueSearchRequest

type ValueSearchRequest struct {
	// Value - Значение для поиска
	//
	// Домен сайта, например "example.com"
	Value utils.Value `json:"value" example:"example.com"`
}

ValueSearchRequest - Запрос на поиск значений

type ValueSearchResponse

type ValueSearchResponse web.Response[[]ValueSearchItem]

ValueSearchResponse - Ответ на запрос поиска значений

Jump to

Keyboard shortcuts

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