ensemble

package
v0.0.0-...-9178f82 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2013 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterService

func RegisterService(name string, service Servicer)

func SoundClass

func SoundClass(category string) string

Types

type Campfire

type Campfire struct {
	Url     string
	Orgname string
	Token   string
	Choir   *choir.Choir

	Rooms map[int]string
	Users map[int]string
}

func (*Campfire) Configure

func (c *Campfire) Configure(config interface{})

func (*Campfire) GetRoom

func (c *Campfire) GetRoom(id int) string

func (*Campfire) GetUser

func (c *Campfire) GetUser(id int) string

func (*Campfire) Run

func (c *Campfire) Run(conductor chan *choir.Note)

type CampfireConfig

type CampfireConfig struct {
	Type    string
	Key     string
	Rooms   []int
	Token   string
	Orgname string
}

type CampfireMessage

type CampfireMessage struct {
	Room_Id   int
	CreatedAt time.Time
	Body      string
	Id        int
	User_Id   int
	Type      string
	Starred   bool
}

type CaseHistory

type CaseHistory struct {
	Total_Entries int
	Embedded      struct {
		Entries []HistoryEntry
	} `json:"_embedded"`
	Links map[string]DeskLink `json:"_links"`
}

type Desk

type Desk struct {
	Url      string
	Username string
	Password string
	Choir    *choir.Choir

	LastUpdate time.Time

	Users map[int]string
}

func (*Desk) Configure

func (d *Desk) Configure(config interface{})

func (*Desk) FetchUpdates

func (d *Desk) FetchUpdates() (feed DeskFeed)

#################################### API IMPLEMENTATION ####################################

func (*Desk) GetUrl

func (d *Desk) GetUrl(path string, decode_object interface{}) error

Generic API Getter

func (*Desk) Run

func (d *Desk) Run(conductor chan *choir.Note)

type DeskConfig

type DeskConfig struct {
	Type string
	Key  string
	Http struct {
		Orgname  string
		Username string
		Password string
	}
}

type DeskEntry

type DeskEntry struct {
	Subject    string
	Status     string
	Created_At time.Time
	Updated_At time.Time
	Links      map[string]DeskLink `json:"_links"`
}

func (*DeskEntry) BuildDescription

func (de *DeskEntry) BuildDescription(d *Desk, since_updated_at time.Time) string

TODO: Build a map of: User -> unique actions Actions to verbs Figure out a way to: Build a sentence from above map If there is no user, do we just say "The case was reopened"?

func (*DeskEntry) GetHistory

func (de *DeskEntry) GetHistory(d *Desk) *CaseHistory

func (*DeskEntry) Id

func (de *DeskEntry) Id() string

type DeskFeed

type DeskFeed struct {
	Total_Entries int
	Embedded      struct {
		Entries []DeskEntry
	} `json:"_embedded"`
}
type DeskLink struct {
	Class string
	Href  string
}

type DeskUser

type DeskUser struct {
	Name string
}

type Github

type Github struct {
	Url        string
	LastUpdate time.Time
	Choir      *choir.Choir
}

func (*Github) Configure

func (g *Github) Configure(config interface{})

func (*Github) FetchUpdates

func (g *Github) FetchUpdates() (feed GithubFeed)

func (*Github) Run

func (g *Github) Run(conductor chan *choir.Note)

type GithubConfig

type GithubConfig struct {
	Type string
	Key  string
	Http struct {
		Username     string
		Orgname      string
		Access_Token string
	}
}

type GithubEntry

type GithubEntry struct {
	Published  time.Time `xml:"published"`
	Id         string    `xml:"id"`
	AuthorName string    `xml:"author>name"`
	Title      string    `xml:"title"`
	Content    string    `xml:"content"`
}

func (*GithubEntry) GetCategory

func (je *GithubEntry) GetCategory() string

func (*GithubEntry) SoundClass

func (ge *GithubEntry) SoundClass() string

type GithubFeed

type GithubFeed struct {
	XMLName xml.Name      `xml:"feed"`
	Updated string        `xml:"updated"`
	Entry   []GithubEntry `xml:"entry"`
}

XML Activity Feed

type HammerTime

type HammerTime struct {
	time.Time
}

func (*HammerTime) UnmarshalJSON

func (t *HammerTime) UnmarshalJSON(data []byte) error

type HistoryEntry

type HistoryEntry struct {
	Type       string
	Created_At time.Time
	Links      map[string]DeskLink `json:"_links"`
}

func (*HistoryEntry) GetUserName

func (he *HistoryEntry) GetUserName(d *Desk) (name string)

func (*HistoryEntry) UserId

func (he *HistoryEntry) UserId() (user_id int)

type Jira

type Jira struct {
	Url        string
	Username   string
	Password   string
	Choir      *choir.Choir
	LastUpdate time.Time
}

func (*Jira) Configure

func (j *Jira) Configure(config interface{})

func (*Jira) FetchUpdates

func (j *Jira) FetchUpdates() (feed JiraFeed)

func (*Jira) Run

func (j *Jira) Run(conductor chan *choir.Note)

type JiraConfig

type JiraConfig struct {
	Type string
	Key  string
	Http struct {
		Domain   string
		Username string
		Password string
	}
}

type JiraEntry

type JiraEntry struct {
	Published time.Time `xml:"published"`
	Category  struct {
		Term string `xml:"term,attr"`
	} `xml:"category"`
	AuthorName string `xml:"author>name"`
	Title      string `xml:"title"`
}

type JiraFeed

type JiraFeed struct {
	XMLName        xml.Name    `xml:"feed"`
	Updated        string      `xml:"updated"`
	TimezoneOffset string      `xml:"timezone-offset"`
	Entry          []JiraEntry `xml:"entry"`
}

XML Activity Feed

type Room

type Room struct {
	Id            int
	Name          string
	LastMessageId int
}

type RoomResponse

type RoomResponse struct {
	Room Room
}

type Servicer

type Servicer interface {
	Configure(config interface{})
	Run(conductor chan *choir.Note)
}

func FindService

func FindService(name string) (s Servicer, ok bool)

type UserResponse

type UserResponse struct {
	User struct {
		Name string
	}
}

type Yammer

type Yammer struct {
	Url         string
	AccessToken string
	Choir       *choir.Choir
	LastId      string
}

func (*Yammer) Configure

func (y *Yammer) Configure(config interface{})

func (*Yammer) FetchUpdates

func (y *Yammer) FetchUpdates() (feed YammerFeed)

func (*Yammer) Run

func (y *Yammer) Run(conductor chan *choir.Note)

type YammerConfig

type YammerConfig struct {
	Type string
	Key  string
	Http struct {
		Access_Token string
	}
}

type YammerFeed

type YammerFeed struct {
	Messages   []YammerMessage
	References []YammerReference
}

func (*YammerFeed) LookupUser

func (yf *YammerFeed) LookupUser(user_id int) (full_name string)

type YammerMessage

type YammerMessage struct {
	Id              int
	Created_at      HammerTime
	Replied_To_Id   int
	Content_Excerpt string
	Body            struct {
		Rich  string
		Plain string
	}
	Sender_Id int
}

func (*YammerMessage) GetCategory

func (ym *YammerMessage) GetCategory() string

func (*YammerMessage) GetText

func (ym *YammerMessage) GetText() string

func (*YammerMessage) SoundClass

func (ym *YammerMessage) SoundClass() string

type YammerReference

type YammerReference struct {
	Type      string
	Id        int
	Full_Name string
}

Jump to

Keyboard shortcuts

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