Documentation ¶
Index ¶
- Constants
- func CheckIfError(err error)
- func GetEnv(key, fallback string) string
- func GetEnvInt(key string, fallback int) int
- func Init(repository *git.Repository, r kelly.Router, config *Config)
- func RemoveContents(dir string) error
- type Commit
- type Config
- type Current
- type GithubHookNotify
- type GitlabHookNotify
- type Global
- type LoginUrl
- type Spec
- type User
Constants ¶
View Source
const ( LOCAL_DIR = "/tmp/data" GIT_ORIGIN = "https://github.com/qjw/test.git" SWAGGER_UI = "/tmp/swagger_ui" FRONTEND = "/tmp/frontend" PORT = 8888 REDIS_URL = "redis://localhost:6379/1" CORP_ID = "" CORP_AGENT_SECRET = "" CORP_AGENT_ID = "" GITLAB_TOKEN = "" GITHUB_TOKEN = "" )
View Source
const (
STATE = "state"
)
Variables ¶
This section is empty.
Functions ¶
func CheckIfError ¶
func CheckIfError(err error)
func RemoveContents ¶
Types ¶
type Config ¶
type Config struct { LocalDir string `json:"localDir"` // 如果不存在,则不从远程Clone GitOrigin string `json:"gitOrigin"` SwaggetUi string `json:"swaggerUI"` Frontend string `json:"frontend"` Port int `json:"port"` // Redis RedisUrl string `json:"redisUrl""` // ----------------------企业号 // 企业号corpid CorpID string `json:"corpID"` // 企业号App密钥 CorpAgentSecret string `json:"corpAgentSecret"` // 因为同一个企业号会有多个Secret,这里用于区分 CorpAgentId string `json:"corpAgentID"` // gitlab/github hook GitlabToken string `json:"gitlabToken"` GithubToken string `json:"githubToken"` }
func InitConfig ¶
func InitConfig() *Config
type GithubHookNotify ¶
type GithubHookNotify struct { Ref string `json:"ref"` Before string `json:"before"` After string `json:"after"` Pusher struct { Name string `json:"name"` Email string `json:"email"` } `json:"pusher,omitempty"` Sender struct { Login string `json:"login"` } `json:"sender,omitempty"` Repository struct { Name string `json:"name"` FullName string `json:"full_name"` HtmlUrl string `json:"html_url"` } `json:"repository,omitempty"` Commits []struct { ID string `json:"id"` Message string `json:"message"` Timestamp string `json:"timestamp"` Url string `json:"url"` } `json:"commits,omitempty"` }
type GitlabHookNotify ¶
type GitlabHookNotify struct { ObjectKind string `json:"object_kind"` // push event EventName string `json:"event_name,omitempty"` Ref string `json:"ref,omitempty"` CheckoutSha string `json:"checkout_sha,omitempty"` TotalCommitsCount int `json:"total_commits_count,omitempty"` Name string `json:"user_name,omitempty"` Email string `json:"user_email,omitempty"` AvatarUrl string `json:"user_avatar,omitempty"` User User `json:"user"` }
Click to show internal directories.
Click to hide internal directories.