Documentation ¶
Index ¶
Constants ¶
const ( ResourceDir = "resources" MainScript = "resources.js" )
Variables ¶
This section is empty.
Functions ¶
func AllScripts ¶
func AllScripts() []string
func AllTypes ¶
func AllTypes() map[db.ResourceType]string
func GraphiteTimestamp ¶
GraphiteTimestamp converts t to a value suitable for use as the from or until argument to the Graphite render API.
Types ¶
type GraphiteDaemon ¶
type GraphiteDaemon struct { // Base is the URL where the server can be found. Base should have a // trailing slash, with the expectation that the render API endpoint is // at Base + "render". Base string }
GraphiteDaemon represents a remote Graphite server. For more information, see http://graphite.readthedocs.org/ .
func (GraphiteDaemon) Query ¶
func (g GraphiteDaemon) Query(target string, from, until time.Time) ([]GraphiteSeries, error)
Query retrieves data stored in Graphite for the given time period.
func (GraphiteDaemon) QueryRecent ¶
func (g GraphiteDaemon) QueryRecent(target string, d time.Duration) ([]GraphiteSeries, error)
QueryRecent retrieves data stored in Graphite for the most recent d time.
type GraphiteResource ¶
func (GraphiteResource) Serialize ¶
func (g GraphiteResource) Serialize() (string, error)
func (GraphiteResource) Type ¶
func (g GraphiteResource) Type() ResourceType
func (GraphiteResource) Validate ¶
func (g GraphiteResource) Validate() []string
type GraphiteResourceDBModel ¶
type GraphiteResourceDBModel struct {
URL string
}
Eventually implemented in DB layer
type GraphiteSeries ¶
GraphiteSeries encapsulates the data returned by Graphite for a particular series. The values in Values correspond to the times between Start and End, inclusive, that are Step times apart. Null values are represented by NaN.
XXX(eefi): It is possible to store NaN in Graphite, and encoding nulls as NaN makes those cases indistinguishable. However, actual NaNs should be rare, and encoding nulls as NaN removes the need for an extra layer of pointer indirection.
type Resource ¶
type Resource interface { ResourceType Serialize() (string, error) Type() ResourceType Validate() []string }
func LoadFromDB ¶
func LoadFromDB(id db.ResourceType, dsJson string) (Resource, error)
func LoadFromParams ¶
func LoadFromParams(id db.ResourceType, dsParams string) (Resource, error)
type ResourceType ¶
type ResourceType interface { Id() db.ResourceType Name() string Templates() string Scripts() []string // contains filtered or unexported methods }
ResourceType and Resource define a common display abstraction for all Resources.
type VM ¶
type VM struct { Resource ResourceParams string ResourceType db.ResourceType ResourceID db.ResourceID Delete bool }
The VM struct is practically identical in purpose to its counterparts in the vm package, as it represents the intermediate structure between Revere's DB representation of the Resource and its front end representation of the Resource.