client

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: Unlicense Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Status(MessageTest) (string, error)
	Query(MessageTest) (string, error)
	Ping() (string, error)
	Event(EventTest) (string, error)
	EventDelete(EventTest) (string, error)
}

func NewClient

func NewClient(hostname string) Client

func NewClientFQDNDisabled

func NewClientFQDNDisabled(hostname string) Client

type ColorTest

type ColorTest string
const (
	CNan    ColorTest = "blue"
	CInf    ColorTest = "purple"
	CClear  ColorTest = "clear"
	CGreen  ColorTest = "green"
	CRed    ColorTest = "red"
	CYellow ColorTest = "yellow"
)

func ParseColorString

func ParseColorString(s string) (ColorTest, error)

func (ColorTest) String

func (c ColorTest) String() string

type EventTest

type EventTest struct {
	Name         string
	Id           string // event id (this is required)
	Color        ColorTest
	Host         string
	Activation   time.Time // When activate the event (default: now)
	Ephemeral    bool      // set to true to say that event can be destroyed
	Text         string
	Order        int       // optional, set priority event on others
	Default      bool      // if set to true this will be the default event
	Expiration   time.Time // optional, if set event will be removed at that time
	TimeLocation string    // optional, set timezone location to create time format
	Remove       bool      // optional, if true this will remove event
}

func (EventTest) String

func (t EventTest) String() string

type MessageTest

type MessageTest struct {
	Color       ColorTest // optional when querying
	Host        string
	Name        string
	Text        string // optional when querying
	Group       string // optional
	Lifetime    string // optional, default in minutes (add "h" (hours), "d" (days) or "w" (weeks) immediately after the number to use instead of minute)
	FQDNEnabled bool
}

func (MessageTest) String

func (message MessageTest) String() string

type XymonClient

type XymonClient struct {
	Host            string
	Port            int
	FQDNEnabled     bool
	TimeoutInSecond int
}

func (XymonClient) Event

func (c XymonClient) Event(evt EventTest) (string, error)

func (XymonClient) EventDelete

func (c XymonClient) EventDelete(evt EventTest) (string, error)

func (XymonClient) Ping

func (c XymonClient) Ping() (string, error)

func (XymonClient) Query

func (c XymonClient) Query(message MessageTest) (string, error)

func (XymonClient) Status

func (c XymonClient) Status(message MessageTest) (string, error)

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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