adminapi

package
v0.0.0-...-e72a620 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserAgentName = "caddy-crowdsec-admin"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Admin

type Admin interface {
	Info(ctx context.Context) Info
	Ping(ctx context.Context) bool
	Healthy(ctx context.Context) bool
	Check(ctx context.Context, ip netip.Addr, forceLive bool) (bool, *models.Decision, error)
}

type AppSec

type AppSec struct {
	Enabled bool
}

type CheckRequest

type CheckRequest struct {
	IP        string
	ForceLive bool
}

type CheckResponse

type CheckResponse struct {
	Blocked bool
	Reason  string
}

type Client

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

func NewClient

func NewClient(cfg ClientConfig) (*Client, error)

func (*Client) Check

func (c *Client) Check(ip netip.Addr, forceLive bool) (*CheckResponse, error)

func (*Client) Health

func (c *Client) Health() (*HealthResponse, error)

func (*Client) Info

func (c *Client) Info() (*InfoResponse, error)

func (*Client) Ping

func (c *Client) Ping() (*PingResponse, error)

type ClientConfig

type ClientConfig struct {
	Address    string
	ConfigFile string
	Adapter    string
}

type HealthResponse

type HealthResponse struct {
	Ok bool
}

type Info

type Info struct {
	StreamingEnabled        bool
	TickerInterval          string
	AppSecURL               string
	ShouldFailHard          bool
	UserAgent               string
	InstanceID              string
	Uptime                  time.Duration
	NumberOfActiveDecisions int
}

type InfoResponse

type InfoResponse struct {
	Streaming               Streaming
	Live                    Live
	AppSec                  AppSec
	ShouldFailHard          bool
	AuthType                string
	UserAgent               string
	InstanceID              string
	Uptime                  time.Duration
	NumberOfActiveDecisions int
}

type Live

type Live struct {
	Enabled bool
	Mode    string
}

type PingResponse

type PingResponse struct {
	Ok bool
}

type Streaming

type Streaming struct {
	Enabled  bool
	Interval string
}

Jump to

Keyboard shortcuts

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