Documentation ¶
Index ¶
- Constants
- type BaseGraph
- type Client
- func (self *Client) CreateComplex(graph *ComplexGraph) (*ComplexGraph, error)
- func (self *Client) CreateGraph(graph *Graph) (*Graph, error)
- func (self *Client) GetComplex(id int) (*ComplexGraph, error)
- func (self *Client) GetComplexByPath(path string) (*ComplexGraph, error)
- func (self *Client) GetComplexList() (ComplexList, error)
- func (self *Client) GetGraph(id int) (*Graph, error)
- func (self *Client) GetGraphByPath(path string) (*Graph, error)
- func (self *Client) GetGraphList() (GraphList, error)
- func (self *Client) Post(path string, data *GraphData) error
- type ComplexGraph
- type ComplexGraphData
- type ComplexList
- type Graph
- type GraphData
- type GraphEssential
- type GraphList
Constants ¶
View Source
const ( MODE_COUNT string = "count" MODE_GAUGE = "gauge" MODE_MODIFIED = "modified" GMODE_GAUGE = "gauge" GMODE_SUBTRACT = "subtract" TYPE_AREA = "AREA" TYPE_LINE1 = "LINE1" TYPE_LINE2 = "LINE2" )
View Source
const ( MODE_DEFAULT = MODE_GAUGE GMODE_DEFAULT = GMODE_GAUGE TYPE_DEFAULT = TYPE_AREA )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
BaseURL string
}
func NewClient ¶
NewClient() creates a new growthforecast.Client struct. You just need to pass it a base URL where all API endpoints will automatically be generated from.
client := growthforecast.NewClient("http://gf.mycompany.com") g, err := client.GetGraphByPath("service/section/graph") if err != nil { log.Fatalf("Error while fetching graph: %s", err) } // Add data to GrowthForecast! client.Post("service/section/graph", &GraphData{ Number: 1 })
func (*Client) CreateComplex ¶
func (self *Client) CreateComplex(graph *ComplexGraph) (*ComplexGraph, error)
func (*Client) CreateGraph ¶
Sends a request to the GrowthForecast server to create a graph. Returns the new Graph created by this operation. This return value is useful to grab server generated parameters such as the grah ID.
func (*Client) GetComplex ¶
func (self *Client) GetComplex(id int) (*ComplexGraph, error)
func (*Client) GetComplexByPath ¶
func (self *Client) GetComplexByPath(path string) (*ComplexGraph, error)
func (*Client) GetComplexList ¶
func (self *Client) GetComplexList() (ComplexList, error)
Fetches the list of ComplexGraphs registered in the GrowthForecast instance.
func (*Client) GetGraphList ¶
type ComplexGraph ¶
type ComplexGraph struct { BaseGraph Data []ComplexGraphData `json:"data"` Sumup bool `json:"sumup"` }
func NewComplexGraph ¶
func NewComplexGraph() *ComplexGraph
type ComplexGraphData ¶
type ComplexList ¶
type ComplexList []GraphEssential
type Graph ¶
type Graph struct { BaseGraph Adjust string `json:"adjust"` AdjustVal string `json:"adjustval"` Color string `json:"color"` Gmode string `json:"gmode"` Llimit int `json:"llmit"` MD5 string `json:"md5"` Meta string `json:"meta"` Mode string `json:"mode"` Stype string `json:"stype"` Sllimit int `json:"sllimit"` Sulimit int `json:"sulimit"` Ulimit int `json:"ulimit"` Unit string `json:"unit"` }
type GraphEssential ¶
type GraphEssential struct { GraphName string `json:"graph_name"` Id int `json:"id,omitempty"` SectionName string `json:"section_name"` ServiceName string `json:"service_name"` }
func (*GraphEssential) GetPath ¶
func (self *GraphEssential) GetPath() string
type GraphList ¶
type GraphList []GraphEssential
Click to show internal directories.
Click to hide internal directories.