Documentation ¶
Index ¶
- Constants
- type Annotation
- func (a *Annotation) AsEpochAnnotation() (ea EpochAnnotation)
- func (a Annotation) Ask(filter string) (bool, error)
- func (a *Annotation) IsOneTimeSet() bool
- func (a *Annotation) IsTimeNotSet() bool
- func (a *Annotation) MatchTimes()
- func (a *Annotation) SetNow()
- func (a *Annotation) ValidateTime() error
- type AnnotationFields
- type Annotations
- type AnnotationsByStartID
- type Client
- type Epoch
- type EpochAnnotation
- type EpochAnnotations
- type RFC3339
Constants ¶
View Source
const ( Message = "Message" StartDate = "StartDate" EndDate = "EndDate" Source = "Source" Host = "Host" CreationUser = "CreationUser" Owner = "Owner" Category = "Category" Url = "Url" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Annotation ¶
type Annotation struct { AnnotationFields StartDate RFC3339 EndDate RFC3339 }
func NewAnnotation ¶
func NewAnnotation(id string, start, end time.Time, user, owner, source, host, category, url, message string) (a Annotation)
func (*Annotation) AsEpochAnnotation ¶
func (a *Annotation) AsEpochAnnotation() (ea EpochAnnotation)
func (Annotation) Ask ¶
func (a Annotation) Ask(filter string) (bool, error)
Ask makes it so annotations can be filtered in memory using github.com/kylebrandt/boolq
func (*Annotation) IsOneTimeSet ¶
func (a *Annotation) IsOneTimeSet() bool
func (*Annotation) IsTimeNotSet ¶
func (a *Annotation) IsTimeNotSet() bool
func (*Annotation) MatchTimes ¶
func (a *Annotation) MatchTimes()
Match Times Sets Both times to the greater of the two times
func (*Annotation) SetNow ¶
func (a *Annotation) SetNow()
func (*Annotation) ValidateTime ¶
func (a *Annotation) ValidateTime() error
type AnnotationFields ¶
type Annotations ¶
type Annotations []Annotation
func (Annotations) AsEpochAnnotations ¶
func (as Annotations) AsEpochAnnotations() EpochAnnotations
type AnnotationsByStartID ¶
type AnnotationsByStartID Annotations
AnnotationsByStartID is a Type to sort by start time then by id
func (AnnotationsByStartID) Len ¶
func (b AnnotationsByStartID) Len() int
func (AnnotationsByStartID) Less ¶
func (b AnnotationsByStartID) Less(i, j int) bool
func (AnnotationsByStartID) Swap ¶
func (b AnnotationsByStartID) Swap(i, j int)
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetAnnotation ¶
func (c *Client) GetAnnotation(id string) (*Annotation, error)
GetAnnotation gets an annotation by ID, and will return nil without an error if the annotation does not exist
func (*Client) GetAnnotations ¶
func (*Client) SendAnnotation ¶
func (c *Client) SendAnnotation(a Annotation) (Annotation, error)
SendAnnotation sends a annotation to an annotations server apiRoot should be "http://foo/api" where the annotation routes would be available at http://foo/api/annotation...
type EpochAnnotation ¶
type EpochAnnotation struct { AnnotationFields StartDate Epoch EndDate Epoch }
func (*EpochAnnotation) AsAnnotation ¶
func (ea *EpochAnnotation) AsAnnotation() (a Annotation)
type EpochAnnotations ¶
type EpochAnnotations []EpochAnnotation
Click to show internal directories.
Click to hide internal directories.