heartbeat

package
v1.2.22 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: Apache-2.0 Imports: 5 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddRequest

type AddRequest struct {
	client.BaseRequest
	Name          string       `json:"name"`
	Description   string       `json:"description,omitempty"`
	Interval      int          `json:"interval"`
	IntervalUnit  Unit         `json:"intervalUnit"`
	Enabled       *bool        `json:"enabled"`
	OwnerTeam     og.OwnerTeam `json:"ownerTeam,omitempty"`
	AlertMessage  string       `json:"alertMessage,omitempty"`
	AlertTag      []string     `json:"alertTags,omitempty"`
	AlertPriority string       `json:"alertPriority,omitempty"`
}

func (AddRequest) Method

func (r AddRequest) Method() string

func (AddRequest) ResourcePath

func (r AddRequest) ResourcePath() string

func (AddRequest) Validate

func (r AddRequest) Validate() error

type AddResult

type AddResult struct {
	client.ResultMetadata
	Heartbeat
}

type Client

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

func NewClient

func NewClient(config *client.Config) (*Client, error)

func (*Client) Add

func (c *Client) Add(context context.Context, request *AddRequest) (*AddResult, error)

func (*Client) Delete

func (c *Client) Delete(context context.Context, heartbeatName string) (*DeleteResult, error)

func (*Client) Disable

func (c *Client) Disable(context context.Context, heartbeatName string) (*HeartbeatInfo, error)

func (*Client) Enable

func (c *Client) Enable(context context.Context, heartbeatName string) (*HeartbeatInfo, error)

func (*Client) Get

func (c *Client) Get(context context.Context, heartbeatName string) (*GetResult, error)

func (*Client) List

func (c *Client) List(context context.Context) (*ListResult, error)

func (*Client) Ping

func (c *Client) Ping(context context.Context, heartbeatName string) (*PingResult, error)

func (*Client) Update

func (c *Client) Update(context context.Context, request *UpdateRequest) (*HeartbeatInfo, error)

type DeleteResult

type DeleteResult struct {
	client.ResultMetadata
	Message string `json:"result"`
}

type GetResult

type GetResult struct {
	client.ResultMetadata
	Heartbeat
}

type Heartbeat

type Heartbeat struct {
	Name          string       `json:"name"`
	Description   string       `json:"description"`
	Interval      int          `json:"interval"`
	Enabled       bool         `json:"enabled"`
	IntervalUnit  string       `json:"intervalUnit"`
	Expired       bool         `json:"expired"`
	OwnerTeam     og.OwnerTeam `json:"ownerTeam"`
	AlertTags     []string     `json:"alertTags"`
	AlertPriority string       `json:"alertPriority"`
	AlertMessage  string       `json:"alertMessage"`
}

type HeartbeatInfo

type HeartbeatInfo struct {
	client.ResultMetadata
	Name    string `json:"name"`
	Enabled bool   `json:"enabled"`
	Expired bool   `json:"expired"`
}

type ListResult

type ListResult struct {
	client.ResultMetadata
	Heartbeats []Heartbeat `json:"heartbeats"`
}

type PingResult

type PingResult struct {
	client.ResultMetadata
	Message string `json:"result"`
}

type Unit

type Unit string
const (
	Minutes Unit = "minutes"
	Hours   Unit = "hours"
	Days    Unit = "days"
)

type UpdateRequest

type UpdateRequest struct {
	client.BaseRequest
	Name          string       `json:"name"`
	Description   string       `json:"description,omitempty"`
	Interval      int          `json:"interval"`
	IntervalUnit  Unit         `json:"intervalUnit"`
	Enabled       *bool        `json:"enabled,omitempty"`
	OwnerTeam     og.OwnerTeam `json:"ownerTeam,omitempty"`
	AlertMessage  string       `json:"alertMessage,omitempty"`
	AlertTag      []string     `json:"alertTags,omitempty"`
	AlertPriority string       `json:"alertPriority,omitempty"`
}

func (UpdateRequest) Method

func (r UpdateRequest) Method() string

func (UpdateRequest) ResourcePath

func (r UpdateRequest) ResourcePath() string

func (UpdateRequest) Validate

func (r UpdateRequest) Validate() error

Jump to

Keyboard shortcuts

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