timeline

package
Version: v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client implements the Opsgenie client for the incidents timeline API.

func NewClient

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

NewClient creates a new Opsgenie client for the incidents timeline API.

func (*Client) GetTimeline

func (c *Client) GetTimeline(ctx context.Context, id string) ([]Entry, error)

GetTimeline can be used to get the timeline entries for an Opsgenie incident.

type Entry

type Entry struct {
	ID        string    `json:"id"`
	Group     string    `json:"group"`
	Type      string    `json:"type"`
	EventTime time.Time `json:"eventTime"`
	Hidden    bool      `json:"hidden"`
	Actor     struct {
		Name string `json:"name"`
		Type string `json:"type"`
	} `json:"actor"`
	Description struct {
		Name string `json:"name"`
		Type string `json:"type"`
	} `json:"description"`
	LastEdit struct {
		EditTime time.Time `json:"editTime"`
		Actor    struct {
			Name string `json:"name"`
			Type string `json:"type"`
		} `json:"actor"`
	} `json:"lastEdit"`
}

Entry is the structure for a single incident timeline entry.

type Response

type Response struct {
	Data struct {
		Entries    []Entry `json:"entries"`
		NextOffset string  `json:"nextOffset"`
	} `json:"data"`
	Took      float64 `json:"took"`
	RequestID string  `json:"requestId"`
}

Response is the structure of the Opsgenie API response.

Source Files

Jump to

Keyboard shortcuts

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