This repository has been archived by the owner on Feb 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
flowdock.go
74 lines (63 loc) · 2.17 KB
/
flowdock.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// Copyright © 2016-present Thomas Rabaix <[email protected]>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.
package flowdock
const (
BUILD_PENDING = 0
BUILD_SUCCESS = 1
BUILD_RUNNING = 2
BUILD_FAILED = 3
BUILD_CANCELLED = 4
)
var flowdockConfiguration = `
Configuration:
Please note, the command use the new Flowdock API.
1. Go to https://www.flowdock.com/oauth/applications
2. Create a new Application
3. Enter name, description and make sure "Short application" is selected.
4. Once validated, Go to "Tools for testing" and create a new source.
5. Press "Generate Source" and store the generated token for later use
as the FLOWDOCK_SOURCE_TOKEN
`
type FlowdockConfig struct {
Organization string
Flow string
Server string
Token string
}
type FlowdockThreadStatus struct {
Color string `json:"color"`
Value string `json:"value"`
}
type FlowdockAuthor struct {
Name string `json:"name"`
Avatar string `json:"avatar"`
Email string `json:"email"`
}
type FlowdockField struct {
Label string `json:"label"`
Value string `json:"value"`
}
type FlowdockThread struct {
Title string `json:"title"`
Body string `json:"body"`
ExternalUrl string `json:"external_url"`
Status *FlowdockThreadStatus `json:"status"`
Fields []*FlowdockField `json:"fields"`
}
type FlowdockMessage struct {
Event string `json:"event"`
Content string `json:"content,omitempty"`
Message string `json:"message,omitempty"`
Title string `json:"title,omitempty"`
Username string `json:"external_user_name,omitempty"`
ExternalId string `json:"external_thread_id,omitempty"`
Token string `json:"flow_token,omitempty"`
Flow string `json:"flow,omitempty"`
Parent string `json:"parent,omitempty"`
Uuid string `json:"uuid,omitempty"`
ThreadId string `json:"thread_id,omitempty"`
Thread *FlowdockThread `json:"thread,omitempty"`
Author *FlowdockAuthor `json:"author,omitempty"`
}