services

package
v0.0.0-...-cb05708 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package services provides Telegram Integration (https://telegram.org/). This is service to interact with / to notify.

Package services provides Telegram Integration (https://telegram.org/). This is service to interact with / to notify.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAlphaNumberic

func GetAlphaNumberic(n int) string

Return random alphanumeric string

func GetAuthorizeUrl

func GetAuthorizeUrl() string

Return Trello Key

func GetBoardLists

func GetBoardLists(
	context context.Context, boardId string, accessToken string) string

Get list of borads

func GetBoards

func GetBoards(context context.Context, accessToken string) string

Get list of borads

func GetChatIdFromCode

func GetChatIdFromCode(context context.Context, code string) (int, string)

GetChatIdFromCode Return Chat id from Code

func GetEventData

func GetEventData(request *http.Request) (string, string)

Return event type and description to post.

func PushToTrello

func PushToTrello(
	context context.Context, listId string, accessToken string,
	event string, desc string)

Push to Trello

func SendHipchatMessage

func SendHipchatMessage(
	context context.Context, text string, room_id string, token string,
	color string) bool

Send telegram message

func SendPushoverMessage

func SendPushoverMessage(
	context context.Context, message string, userKey string) int

Send push over notification message

func SendSlackMessage

func SendSlackMessage(
	context context.Context, text string, slack_url string,
	channel string) bool

SendTeleMessage Send telegram message

func SendTeleMessage

func SendTeleMessage(context context.Context, text string, chat_id int)

SendTeleMessage Send telegram message

func Telegram

func Telegram(
	context context.Context, decoder *json.Decoder, token string) string

Telegram webhook

Types

type ADClientPayload

type ADClientPayload struct {
	ClientId string
	AppId    string
}

type ADHook

type ADHook struct {
	HookId      string
	Tenant      string
	CallbackUrl string
	CreatedBy   string
	EventType   string
	CreatedDate string
	SysType     string
	CreatorType string
	Status      string
	Scope       ADScope
	Urn         string
	// contains filtered or unexported fields
}

type ADPayload

type ADPayload struct {
	ResourceUrn string
	Payload     ADClientPayload
	Hook        ADHook
}

type ADScope

type ADScope struct {
	// contains filtered or unexported fields
}

type BBActor

type BBActor struct {
	Username     string
	Display_name string
	Uuid         string
	Links        string
}

type BBApproval

type BBApproval struct {
	Date string
	User BBActor
}

type BBAuthor

type BBAuthor struct {
	User User
	Raw  string
}

type BBBranch

type BBBranch struct {
	Name string
}

type BBChanges

type BBChanges struct {
	Commits []BBCommits
	New     BBNew
	Old     BBNew
	Created bool
	Forced  bool
	Closed  bool
}

type BBComment

type BBComment struct {
	Id         int
	Parent     BBParent
	Content    BBContent
	Inline     BBInline
	Created_on string
	Updated_on string
	Links      BBLinks
}

type BBCommits

type BBCommits struct {
	Message string
	Hash    string
	Type    string
	Date    string
	Author  BBAuthor
}

type BBContent

type BBContent struct {
	Raw    string
	Markup string
	Html   string
}

type BBInline

type BBInline struct {
	To   int
	From int
	Path string
}
type BBLink struct {
	Href string
}
type BBLinks struct {
	Html BBLink
	Diff BBLink
	Self BBLink
}

type BBNew

type BBNew struct {
	Type    string
	Name    string
	Target  BBCommits
	Parents BBCommits
}

type BBParent

type BBParent struct {
	Id int
}

type BBPayload

type BBPayload struct {
	Repository  BBRepository
	Push        BBPush
	Actor       BBActor
	Fork        BBRepository
	Comment     BBComment
	Commit      BBCommits
	Pullrequest BBPullrequest
	Approval    BBApproval
}

type BBPullrequest

type BBPullrequest struct {
	Id                  int
	Title               string
	Description         string
	State               string
	Author              string
	Source              BBSource
	Destination         BBSource
	Merge_commit        BBCommits
	Participants        []BBActor
	Reviewers           []BBActor
	Close_source_branch bool
	Closed_by           BBActor
	Reason              string
	Created_on          string
	Updated_on          string
	Links               BBLinks
}

type BBPush

type BBPush struct {
	Changes []BBChanges
}

type BBRepository

type BBRepository struct {
	Name       string
	Full_name  string
	Uuid       string
	Links      BBLinks
	Scm        string
	Is_private bool
}

type BBSource

type BBSource struct {
	Branch     BBBranch
	Commit     BBCommits
	Repository BBRepository
}

type CMessage

type CMessage struct {
	Message string `json:"message"`
}

type Config

type Config struct {
	PushoverKey  string
	TrelloKey    string
	TrelloSecret string
	TeleToken    string
}

type DBApplication

type DBApplication struct {
	Name string
}

type DBData

type DBData struct {
	Email string
	Url   string

	User_Agent  string
	Message     string
	Sentiment   string
	Application DBApplication
	Created     string
	// contains filtered or unexported fields
}

type DBPayload

type DBPayload struct {
	Event string
	Data  DBData
}

type EvalMatch

type EvalMatch struct {
	Value  int
	Metric string
	Tags   []string
}

type FBMessage

type FBMessage struct {
	Event        string
	Payload_type string
	Payload      FBPayload
}

type FBPayload

type FBPayload struct {
	Display_id             int
	Title                  string
	Method                 string
	Crashes_count          int
	Impacted_devices_count int
	Impact_level           int
	Url                    string
	App                    FBPayloadApp
}

type FBPayloadApp

type FBPayloadApp struct {
	Name              string
	Bundle_identifier string
	Platform          string
}

type GitCommit

type GitCommit struct {
	Id        string
	Message   string
	Timestamp string
	Url       string
	Author    User
	Committer User
	Modified  []string
}

type GitPayload

type GitPayload struct {
	Zen          string
	Ref          string
	Compare      string
	Repository   GitRepository
	Commits      []GitCommit
	Action       string
	Number       int
	Pull_request GitPullRequest
	Pusher       User
}

type GitPullRequest

type GitPullRequest struct {
	Url       string
	Html_url  string
	Id        int
	State     string
	Title     string
	User      GitUser
	Body      string
	Repo      GitRepository
	Merged    bool
	Merged_by GitUser
}

type GitRepository

type GitRepository struct {
	Id          int
	Name        string
	Full_name   string
	Url         string
	AbsoluteUrl string
	Owner       User
	Pusher      User
}

type GitUser

type GitUser struct {
	Login      string
	Id         int
	Avatar_url string
	Type       string
	Site_admin bool
}

type GrafanaPayload

type GrafanaPayload struct {
	EvalMatches []EvalMatch
	ImageUrl    string
	Message     string
	RuleId      int
	RuleName    string
	RuleUrl     string
	State       string
	Title       string
}

type JJNBuild

type JJNBuild struct {
	Full_url string
	Number   int
	Queue_id int
	Phase    string
	Status   string
	Url      string
	Scm      JJNScm
}

type JJNMessage

type JJNMessage struct {
	Name  string
	Url   string
	Build JJNBuild
	Log   string
}

type JJNScm

type JJNScm struct {
	Url    string
	Branch string
	Commit string
}

type PDMessage

type PDMessage struct {
	Action      string
	Check       string
	Checkname   string
	Description string
	Host        string
	IncidentId  int
}

type SDIncident

type SDIncident struct {
	Incident_id    string
	Resource_id    string
	Resource_name  string
	State          string
	Started_at     int
	Ended_at       int
	Policy_name    string
	Condition_name string
	Url            string
	Summary        string
}

type SDMessage

type SDMessage struct {
	Incident SDIncident
	Version  int
}

type TCBuild

type TCBuild struct {
	BuildStatus           string
	BuildResult           string
	BuildResultPrevious   string
	BuildResultDetalta    string
	NotifyType            string
	BuildFullName         string
	BuildName             string
	BuildId               string
	BuildTypeId           string
	BuildInternalTypeId   string
	BuildExternalTypeId   string
	BuildStatusUrl        string
	BuildStatusHtml       string
	RootUrl               string
	ProjectName           string
	ProjectId             string
	ProjectInternalId     string
	ProjectExternalId     string
	BuildNumber           string
	AgentName             string
	AgentOs               string
	AgentHostname         string
	TriggeredBy           string
	Message               string
	Text                  string
	BuildStateDescription string
}

type TCPayload

type TCPayload struct {
	Build TCBuild
}

type TRPayload

type TRPayload struct {
	Author_email        string
	Author_name         string
	Branch              string
	Build_url           string
	Commit              string
	Committed_at        string
	Committer_email     string
	Committer_name      string
	Compare_url         string
	Duration            int
	Finished_at         string
	Id                  int
	Message             string
	Number              string
	Repository          TRRepository
	Started_at          string
	State               string
	Status              int
	Status_message      string
	Type                string
	Pull_request        bool
	Pull_request_number string
	Pull_request_type   string
	Tag                 string
}

type TRRepository

type TRRepository struct {
	Id         int
	Name       string
	Owner_name string
	Url        string
}

type TrelloPayLoad

type TrelloPayLoad struct {
	Name string
	Desc string
}

To send as trello api payload.

type User

type User struct {
	Name         string
	Email        string
	Username     string
	Display_name string
}

Jump to

Keyboard shortcuts

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