Documentation ¶
Index ¶
- Constants
- func NewFluentLogger(tag string, args map[string]interface{}) *gologging.Logger
- type BuildBot
- func (b *BuildBot) Build(owner, repo, branch, sha string) error
- func (b *BuildBot) GetImageName(description string) (string, error)
- func (this *BuildBot) GetLogContent(url string) (string, error)
- func (b *BuildBot) GetLogURL(description string) (string, error)
- func (b *BuildBot) Proxy(method string, header http.Header, body []byte) error
- type BuildbotChangeHook
- type ByOrg
- type ByRepos
- type Config
- type Docker
- func (this *Docker) CheckImage(imageName string) bool
- func (this *Docker) DeleteImage(imageName, tag string) error
- func (this *Docker) GetOfficialRegistryAuthToken(name string) (string, error)
- func (this *Docker) IsRepositoryV2(repo string) (bool, error)
- func (this *Docker) ListImageTags(fullname string) ([]string, error)
- func (this *Docker) ListImageTagsV1(repo, name, token string) ([]string, error)
- func (this *Docker) ListImageTagsV2(repo, name, token string) ([]string, error)
- type DockerRepositoryAuth
- type Elastic
- type GitHub
- func (this *GitHub) AddCollaborator(owner, repo, collaborator string) error
- func (this *GitHub) CheckDockerfile(owner string, repo string) (bool, error)
- func (this *GitHub) CreateCommitStatus(owner, repo, ref, statusStr string)
- func (this *GitHub) CreateDeployment(owner, repo, ref, description string) (int, error)
- func (this *GitHub) CreateDeploymentStatus(owner, repo string, id int, state string)
- func (this *GitHub) GetBranch(owner, repo, branchName string) (*github.Branch, error)
- func (this *GitHub) GetCommit(owner, repo, sha string) (*github.RepositoryCommit, error)
- func (this *GitHub) GetDefaultBranchName(owner, repo string) (string, error)
- func (this *GitHub) GetLoginURL() string
- func (this *GitHub) GetOAuth2Token(state, code string) (string, error)
- func (this *GitHub) GetRepo(owner, repo string) (*github.Repository, error)
- func (this *GitHub) GetSHA(owner, repo, branch string) (string, error)
- func (this *GitHub) GetUser() (*github.User, error)
- func (this *GitHub) ListBranches(owner, repo string, opt *github.ListOptions) ([]github.Branch, error)
- func (this *GitHub) ListCommits(owner, repo string, opt *github.CommitsListOptions) ([]github.RepositoryCommit, error)
- func (this *GitHub) ListDeploymentStatuses(owner, repo string, deployment int) ([]github.DeploymentStatus, error)
- func (this *GitHub) ListDeployments(owner, repo string, opt *github.DeploymentsListOptions) ([]github.Deployment, error)
- func (this *GitHub) ListHooks(owner, repo string) ([]github.Hook, error)
- func (this *GitHub) ListOrgRepos(org string) ([]github.Repository, error)
- func (this *GitHub) ListOrgs() ([]github.Organization, error)
- func (this *GitHub) ListOwnerRepos() ([]github.Repository, error)
- func (this *GitHub) ListStatuses(owner, repo, ref string) ([]github.RepoStatus, error)
- func (this *GitHub) UpsertHook(owner, repo string) error
- type Kubernetes
- func (this *Kubernetes) DeleteNamespace(nsName string) error
- func (this *Kubernetes) DeletePod(nsName, podName string) error
- func (this *Kubernetes) DeleteReplicationController(nsName, rcName string) error
- func (this *Kubernetes) DeleteService(nsName, svcName string) error
- func (this *Kubernetes) GetAllNamespaces() ([]api.Namespace, error)
- func (this *Kubernetes) GetAllPods(nsName string) ([]api.Pod, error)
- func (this *Kubernetes) GetAllReplicationControllers(nsName string) ([]api.ReplicationController, error)
- func (this *Kubernetes) GetAllServices(namespace string, requirements ...labels.Requirement) ([]api.Service, error)
- func (this *Kubernetes) GetEndpoints(nsName string, labelMap map[string]string) ([]api.Endpoints, error)
- func (this *Kubernetes) GetLabels(githubRepo, gitBranch string) map[string]string
- func (this *Kubernetes) GetNamespace(name string) (*api.Namespace, error)
- func (this *Kubernetes) GetNamespaces(labelMap map[string]string) ([]api.Namespace, error)
- func (this *Kubernetes) GetPodLogs(nsName, podID string, createdAt time.Time) (string, error)
- func (this *Kubernetes) GetPods(nsName string, labelMap map[string]string) ([]api.Pod, error)
- func (this *Kubernetes) GetReplicationController(nsName, rcName string) (*api.ReplicationController, error)
- func (this *Kubernetes) GetReplicationControllers(nsName string, labelMap map[string]string, requirements ...labels.Requirement) ([]api.ReplicationController, error)
- func (this *Kubernetes) GetService(nsName, svcName string) (*api.Service, *Metadata, error)
- func (this *Kubernetes) GetServices(namespace string, labelMap map[string]string) ([]api.Service, error)
- func (this *Kubernetes) ScaleReplicationController(nsName, rcName string, replicas int) (*api.ReplicationController, error)
- func (this *Kubernetes) UpdateReplicationController(nsName string, rc *api.ReplicationController) (*api.ReplicationController, error)
- func (this *Kubernetes) UpdateService(nsName string, svc *api.Service) (*api.Service, error)
- func (this *Kubernetes) UpsertNamespace(namespace string) error
- func (this *Kubernetes) UpsertReplicationController(nsName, rcGenerateName, imageName string, ...) error
- func (this *Kubernetes) UpsertService(nsName, svcName string, svcLabels, svcSelector map[string]string, ...) (*api.Service, error)
- func (this *Kubernetes) WaitForRC(rc *api.ReplicationController) error
- type LogChunk
- type LogChunks
- type Metadata
- type Notification
- type Notifier
- type Util
- func (this *Util) Hash(in interface{}) (string, error)
- func (this *Util) Normalize(delim string, args ...string) string
- func (this *Util) NormalizeByHyphen(delim string, args ...string) string
- func (this *Util) NormalizeGitBranch(delim string, args ...string) string
- func (this *Util) TCPPortsToList(in string) ([]int, error)
- type WatchCenter
- type WatchCenterGroup
- type WatchCenterGroupResponse
- type WatchCenterResponse
Constants ¶
View Source
const ( OFFICIAL_DOCKER_REPOSITORY_URL = "registry.hub.docker.com" OFFICIAL_DOCKER_AUTH_URL = "auth.docker.io/token" OFFICIAL_DOCKER_AUTH_SERVICE = "registry.docker.io" OFFICIAL_DOCKER_AUTH_SCOPE = "repository:%v:pull" )
View Source
const ( APP_LOG_TMPL = `` /* 942-byte string literal not displayed */ DEPLOY_LOG_TMPL = `` /* 647-byte string literal not displayed */ )
View Source
const ( CITE_BUILDBOT_GITHUB_CONTEXT = "buildbot/cite-build" CITE_K8S_ANNOTATION_KEY = "cite.io/created-by" )
View Source
const ( SendGroupTalk = "/send/group/kakaotalk" SendPersonalTalk = "/send/personal/kakaotalk" ListGroups = "/user/%s/groups" )
View Source
const (
LOG_FORMAT = `%{color}%{level:.4s} %{shortfile}%{color:reset} | %{message}`
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BuildBot ¶
type BuildBot struct {
// contains filtered or unexported fields
}
func NewBuildBot ¶
func NewBuildBot() *BuildBot
type BuildbotChangeHook ¶
type BuildbotChangeHook struct { Project string `json:"project"` Revision string `json:"revision"` Branch string `json:"branch"` RevLink string `json:"revlink"` Repository string `json:"repository"` CreatedAt time.Time `json:"when_timestamp"` Author string `json:"author"` Comments string `json:"comments"` }
type ByOrg ¶
type ByOrg []github.Organization
type ByRepos ¶
type ByRepos []github.Repository
type Config ¶
type Config struct { Cite struct { Host string ListenPort string RCRetentionDuration string Version string } Aggregator struct { Host string } Buildbot struct { Host string WebHook string } ElasticSearch struct { Host string KibanaHost string } LoadBalancer struct { Driver string } GitHub struct { AccessToken string API string ClientID string ClientSecret string Host string OAuthAuthURL string OAuthTokenURL string Scope string Username string WebhookURI string } Grafana struct { Host string } Kubernetes struct { Master string MaxPods int MinInitialDelay int MaxInitialDelay int PollInterval int PollTimeout int DefaultCPU string DefaultMemory string MaxCPU string MaxMemory string } Notification struct { Watchcenter struct { API string } Slack struct { ClientID string ClientSecret string RedirectURI string } Default struct { Slack string } } }
var (
Conf Config
)
type Docker ¶
type Docker struct{}
func (*Docker) CheckImage ¶
func (*Docker) DeleteImage ¶
func (*Docker) GetOfficialRegistryAuthToken ¶
func (*Docker) ListImageTagsV1 ¶
type DockerRepositoryAuth ¶
type DockerRepositoryAuth struct {
Token string `json:"token"`
}
type Elastic ¶
type Elastic struct { GMT *time.Location AppLogTmpl *template.Template DeployLogTmpl *template.Template // contains filtered or unexported fields }
func NewElastic ¶
func NewElastic() *Elastic
func (*Elastic) GetAppLogURL ¶
func (*Elastic) GetDeployLogURL ¶
func (*Elastic) UpsertKibanaIndexPattern ¶
type GitHub ¶
type GitHub struct {
// contains filtered or unexported fields
}
func NewCommonGitHub ¶
func NewCommonGitHub() *GitHub
func (*GitHub) AddCollaborator ¶
func (*GitHub) CheckDockerfile ¶
func (*GitHub) CreateCommitStatus ¶
func (*GitHub) CreateDeployment ¶
func (*GitHub) CreateDeploymentStatus ¶
func (*GitHub) GetCommit ¶
func (this *GitHub) GetCommit(owner, repo, sha string) (*github.RepositoryCommit, error)
func (*GitHub) GetDefaultBranchName ¶
func (*GitHub) GetLoginURL ¶
func (*GitHub) GetOAuth2Token ¶
func (*GitHub) GetRepo ¶
func (this *GitHub) GetRepo(owner, repo string) (*github.Repository, error)
func (*GitHub) ListBranches ¶
func (*GitHub) ListCommits ¶
func (this *GitHub) ListCommits(owner, repo string, opt *github.CommitsListOptions) ([]github.RepositoryCommit, error)
func (*GitHub) ListDeploymentStatuses ¶
func (*GitHub) ListDeployments ¶
func (this *GitHub) ListDeployments(owner, repo string, opt *github.DeploymentsListOptions) ([]github.Deployment, error)
func (*GitHub) ListOrgRepos ¶
func (this *GitHub) ListOrgRepos(org string) ([]github.Repository, error)
func (*GitHub) ListOwnerRepos ¶
func (this *GitHub) ListOwnerRepos() ([]github.Repository, error)
func (*GitHub) ListStatuses ¶
func (this *GitHub) ListStatuses(owner, repo, ref string) ([]github.RepoStatus, error)
func (*GitHub) UpsertHook ¶
type Kubernetes ¶
type Kubernetes struct {
// contains filtered or unexported fields
}
func NewKubernetes ¶
func NewKubernetes() *Kubernetes
func (*Kubernetes) DeleteNamespace ¶
func (this *Kubernetes) DeleteNamespace(nsName string) error
func (*Kubernetes) DeletePod ¶
func (this *Kubernetes) DeletePod(nsName, podName string) error
func (*Kubernetes) DeleteReplicationController ¶
func (this *Kubernetes) DeleteReplicationController(nsName, rcName string) error
func (*Kubernetes) DeleteService ¶
func (this *Kubernetes) DeleteService(nsName, svcName string) error
func (*Kubernetes) GetAllNamespaces ¶
func (this *Kubernetes) GetAllNamespaces() ([]api.Namespace, error)
func (*Kubernetes) GetAllPods ¶
func (this *Kubernetes) GetAllPods(nsName string) ([]api.Pod, error)
func (*Kubernetes) GetAllReplicationControllers ¶
func (this *Kubernetes) GetAllReplicationControllers(nsName string) ([]api.ReplicationController, error)
func (*Kubernetes) GetAllServices ¶
func (this *Kubernetes) GetAllServices(namespace string, requirements ...labels.Requirement) ([]api.Service, error)
func (*Kubernetes) GetEndpoints ¶
func (*Kubernetes) GetLabels ¶
func (this *Kubernetes) GetLabels(githubRepo, gitBranch string) map[string]string
func (*Kubernetes) GetNamespace ¶
func (this *Kubernetes) GetNamespace(name string) (*api.Namespace, error)
func (*Kubernetes) GetNamespaces ¶
func (*Kubernetes) GetPodLogs ¶
func (*Kubernetes) GetReplicationController ¶
func (this *Kubernetes) GetReplicationController(nsName, rcName string) (*api.ReplicationController, error)
func (*Kubernetes) GetReplicationControllers ¶
func (this *Kubernetes) GetReplicationControllers(nsName string, labelMap map[string]string, requirements ...labels.Requirement) ([]api.ReplicationController, error)
func (*Kubernetes) GetService ¶
func (*Kubernetes) GetServices ¶
func (*Kubernetes) ScaleReplicationController ¶
func (this *Kubernetes) ScaleReplicationController(nsName, rcName string, replicas int) (*api.ReplicationController, error)
func (*Kubernetes) UpdateReplicationController ¶
func (this *Kubernetes) UpdateReplicationController(nsName string, rc *api.ReplicationController) (*api.ReplicationController, error)
func (*Kubernetes) UpdateService ¶
func (*Kubernetes) UpsertNamespace ¶
func (this *Kubernetes) UpsertNamespace(namespace string) error
func (*Kubernetes) UpsertReplicationController ¶
func (*Kubernetes) UpsertService ¶
func (*Kubernetes) WaitForRC ¶
func (this *Kubernetes) WaitForRC(rc *api.ReplicationController) error
type LogChunks ¶
type LogChunks struct { Meta interface{} `json:"meta"` LogChunks []LogChunk `json:"logchunks"` }
type Metadata ¶
type Metadata struct { Namespace string `json:"namespace" form:"namespace" form:"namespace"` Service string `json:"service" form:"service" schema:"service"` GithubOrg string `json:"github_org" form:"github_org" schema:"github_org"` GithubRepo string `json:"github_repo" form:"github_repo" schema:"github_repo"` GitBranch string `json:"git_branch" form:"git_branch" schema:"git_branch"` AutoDeploy bool `json:"auto_deploy" form:"auto_deploy" schema:"auto_deploy"` ContainerPort int `json:"container_port" form:"container_port" schema:"container_port"` ContainerPorts []int `json:"container_ports"` HTTPPort string `json:"http_port" form:"http_port" schema:"http_port"` TCPPort string `json:"tcp_port" form:"tcp_port" schema:"tcp_port"` ProbePath string `json:"probe_path" form:"probe_path" schema:"probe_path"` Replicas int `json:"replicas" form:"replicas" schema:"replicas"` Watchcenter int `json:"watchcenter" form:"watchcenter" schema:"watchcenter"` Environment string `json:"environment" form:"environment" schema:"environment"` Notification []Notification `json:"notification" schema:"noti"` // contains filtered or unexported fields }
func UnmarshalMetadata ¶
func (*Metadata) EnvironmentMap ¶
type Notification ¶
type Notifier ¶
type Notifier struct {
// contains filtered or unexported fields
}
func NewNotifier ¶
func NewNotifier() *Notifier
func (*Notifier) SendSystem ¶
func (*Notifier) SendWithFallback ¶
func (n *Notifier) SendWithFallback(nms []Notification, wc int, msg string) error
type Util ¶
type Util struct {
// contains filtered or unexported fields
}
func (*Util) NormalizeByHyphen ¶
func (*Util) NormalizeGitBranch ¶
type WatchCenter ¶
type WatchCenter struct {
// contains filtered or unexported fields
}
func NewWatchCenter ¶
func NewWatchCenter() *WatchCenter
func (*WatchCenter) ListGroups ¶
func (this *WatchCenter) ListGroups(username, email string) ([]WatchCenterGroup, error)
func (*WatchCenter) SendGroupTalk ¶
func (this *WatchCenter) SendGroupTalk(to int, msg string)
func (*WatchCenter) SendPersonalTalk ¶
func (this *WatchCenter) SendPersonalTalk(to, msg string)
type WatchCenterGroup ¶
type WatchCenterGroup struct { Id int `json:"id"` Category struct { Type string `json:"type"` UnconditionalInvite bool `json:"unconditionalInvite"` } `json:"category"` Name string `json:"name"` Description string `json:"description"` ServiceCode string `json:"serviceCode"` LegacyId string `json:"legacyId,omitempty"` UnconditionalInvite bool `json:"unconditionalInvite"` }
type WatchCenterGroupResponse ¶
type WatchCenterGroupResponse struct { Code string `json:"code"` Message string `json:"message"` Response []WatchCenterGroup `json:response` }
Click to show internal directories.
Click to hide internal directories.