doomsday

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2023 License: Unlicense Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheItem

type CacheItem struct {
	Paths      []CacheItemPath `json:"paths"`
	CommonName string          `json:"common_name"`
	NotAfter   int64           `json:"not_after"`
}

type CacheItemFilter

type CacheItemFilter struct {
	Beyond *time.Duration
	Within *time.Duration
}

type CacheItemPath

type CacheItemPath struct {
	Backend  string `json:"backend"`
	Location string `json:"location"`
}

type CacheItems

type CacheItems []CacheItem

func (CacheItems) Filter

func (c CacheItems) Filter(filter CacheItemFilter) CacheItems

Filter only works if the given CacheItems is sorted by NotAfter

type Client

type Client struct {
	Client *http.Client
	URL    url.URL
	Token  string
	Trace  io.Writer
}

func (*Client) GetCache

func (c *Client) GetCache() (CacheItems, error)

GetCache gets the cache list

func (*Client) GetSchedulerState

func (c *Client) GetSchedulerState() (*GetSchedulerResponse, error)

func (*Client) Info

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

func (*Client) RefreshCache

func (c *Client) RefreshCache() error

RefreshCache makes a request to asynchronously refresh the server cache

func (*Client) UserpassAuth

func (c *Client) UserpassAuth(username, password string) error

UserpassAuth attempts to authenticate with the doomsday server. If successful, the response is stored into the client

type ErrBadRequest

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

func (*ErrBadRequest) Error

func (e *ErrBadRequest) Error() string

type ErrInternalServer

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

func (*ErrInternalServer) Error

func (e *ErrInternalServer) Error() string

type ErrUnauthorized

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

func (*ErrUnauthorized) Error

func (e *ErrUnauthorized) Error() string

type GetCacheResponse

type GetCacheResponse struct {
	Content CacheItems `json:"content"`
}

type GetSchedulerResponse

type GetSchedulerResponse struct {
	Running []GetSchedulerTask   `json:"running"`
	Pending []GetSchedulerTask   `json:"pending"`
	Workers []GetSchedulerWorker `json:"workers"`
}

type GetSchedulerTask

type GetSchedulerTask struct {
	At       int64  `json:"at"`
	Backend  string `json:"backend"`
	Reason   string `json:"reason"`
	Kind     string `json:"kind"`
	ID       uint   `json:"id"`
	State    string `json:"state"`
	WorkerID int    `json:"worker_id"`
}

type GetSchedulerWorker

type GetSchedulerWorker struct {
	ID      uint   `json:"id"`
	State   string `json:"state"`
	StateAt int64  `json:"state_at"`
}

type InfoResponse

type InfoResponse struct {
	Version  string        `json:"version"`
	AuthType auth.AuthType `json:"auth_type"`
}

Jump to

Keyboard shortcuts

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