Index | Files | Directories

package annotate

import ""


Package Files

client.go models.go


const (
    Message      = "Message"
    StartDate    = "StartDate"
    EndDate      = "EndDate"
    Source       = "Source"
    Host         = "Host"
    CreationUser = "CreationUser"
    Owner        = "Owner"
    Category     = "Category"
    Url          = "Url"

type Annotation Uses

type Annotation struct {
    StartDate RFC3339
    EndDate   RFC3339

func NewAnnotation Uses

func NewAnnotation(id string, start, end time.Time, user, owner, source, host, category, url, message string) (a Annotation)

func (*Annotation) AsEpochAnnotation Uses

func (a *Annotation) AsEpochAnnotation() (ea EpochAnnotation)

func (Annotation) Ask Uses

func (a Annotation) Ask(filter string) (bool, error)

Ask makes it so annotations can be filtered in memory using

func (*Annotation) IsOneTimeSet Uses

func (a *Annotation) IsOneTimeSet() bool

func (*Annotation) IsTimeNotSet Uses

func (a *Annotation) IsTimeNotSet() bool

func (*Annotation) MatchTimes Uses

func (a *Annotation) MatchTimes()

Match Times Sets Both times to the greater of the two times

func (*Annotation) SetNow Uses

func (a *Annotation) SetNow()

func (*Annotation) ValidateTime Uses

func (a *Annotation) ValidateTime() error

type AnnotationFields Uses

type AnnotationFields struct {
    Id           string
    Message      string
    CreationUser string
    Url          string
    Source       string
    Host         string
    Owner        string
    Category     string

type Annotations Uses

type Annotations []Annotation

func (Annotations) AsEpochAnnotations Uses

func (as Annotations) AsEpochAnnotations() EpochAnnotations

type AnnotationsByStartID Uses

type AnnotationsByStartID Annotations

AnnotationsByStartID is a Type to sort by start time then by id

func (AnnotationsByStartID) Len Uses

func (b AnnotationsByStartID) Len() int

func (AnnotationsByStartID) Less Uses

func (b AnnotationsByStartID) Less(i, j int) bool

func (AnnotationsByStartID) Swap Uses

func (b AnnotationsByStartID) Swap(i, j int)

type Client Uses

type Client struct {
    // contains filtered or unexported fields

func NewClient Uses

func NewClient(apiRoot string) Client

func (*Client) GetAnnotation Uses

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 Uses

func (c *Client) GetAnnotations(start, end *time.Time, source, host, creationUser, owner, category, url, message string) (Annotations, error)

func (*Client) SendAnnotation Uses

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 Epoch Uses

type Epoch struct {

func (Epoch) MarshalJSON Uses

func (t Epoch) MarshalJSON() ([]byte, error)

func (*Epoch) UnmarshalJSON Uses

func (t *Epoch) UnmarshalJSON(b []byte) (err error)

type EpochAnnotation Uses

type EpochAnnotation struct {
    StartDate Epoch
    EndDate   Epoch

func (*EpochAnnotation) AsAnnotation Uses

func (ea *EpochAnnotation) AsAnnotation() (a Annotation)

type EpochAnnotations Uses

type EpochAnnotations []EpochAnnotation

type RFC3339 Uses

type RFC3339 struct {

func (RFC3339) MarshalJSON Uses

func (t RFC3339) MarshalJSON() ([]byte, error)

func (*RFC3339) UnmarshalJSON Uses

func (t *RFC3339) UnmarshalJSON(b []byte) (err error)



Package annotate imports 8 packages (graph) and is imported by 6 packages. Updated 2020-07-23. Refresh now. Tools for package owners.