cti

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 2, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UserAgent = fmt.Sprintf("ipdex-%s", version.String())
)

Functions

This section is empty.

Types

type CTI

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

func NewCTIClient

func NewCTIClient(apiKey string, dbClient database.IPClient) (*CTI, error)

func (*CTI) Enrich

func (c *CTI) Enrich(ipAddr string, forceRefresh bool) (*cticlient.SmokeItem, bool, error)

func (*CTI) Search

func (c *CTI) Search(params SearchParams) (*SearchResponse, error)

type CrowdsecClient

type CrowdsecClient interface {
	GetIPInfo(ip string) (*cticlient.SmokeItem, error)
}
type Link struct {
	Href string `json:"href"`
}
type Links struct {
	Self  Link `json:"self"`
	Next  Link `json:"next"`
	Prev  Link `json:"prev"`
	First Link `json:"first"`
}

type SearchPaginator

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

func NewSearchPaginator

func NewSearchPaginator(client *CTI, params SearchParams) *SearchPaginator

func (*SearchPaginator) Next

func (p *SearchPaginator) Next() ([]*cticlient.SmokeItem, error)

type SearchParams

type SearchParams struct {
	Since *string `json:"since"`
	Page  *int    `json:"page"`
	Limit *int    `json:"limit"`
	Query *string `json:"query"`
}

type SearchResponse

type SearchResponse struct {
	Items []*cticlient.SmokeItem `json:"items"`
	Links *Links                 `json:"_links"`
}

Jump to

Keyboard shortcuts

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