Documentation ¶
Index ¶
- Variables
- func DefaultHmacAuthValidator(payload []byte, secret string, signature string, c echo.Context) (bool, error)
- func HmacAuth(secret string) echo.MiddlewareFunc
- func HmacAuthWithConfig(config HmacAuthConfig) echo.MiddlewareFunc
- func LoginAuth(username, password string) smtp.Auth
- func StartServer(cfgfile string)
- type Build
- type Config
- type Controller
- type GitPushEventData
- type HmacAuthConfig
- type HmacAuthValidator
- type Job
- type Jobs
- type Queue
- type Template
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultHmacAuthConfig is the default HmacAuth middleware config. DefaultHmacAuthConfig = HmacAuthConfig{ Skipper: middleware.DefaultSkipper, Validator: DefaultHmacAuthValidator, } )
Functions ¶
func HmacAuth ¶
func HmacAuth(secret string) echo.MiddlewareFunc
HmacAuth returns an HmacAuth middleware.
For valid hash it calls the next handler. For missing or invalid hash, it sends "403 - Forbidden" response.
func HmacAuthWithConfig ¶
func HmacAuthWithConfig(config HmacAuthConfig) echo.MiddlewareFunc
HmacAuthWithConfig returns an HmacAuth middleware with config. See `HmacAuth()`.
func StartServer ¶
func StartServer(cfgfile string)
Types ¶
type Build ¶
type Build struct { ID string Queue string Status string // waiting, building, failure success Logfile string Startdate time.Time Enddate time.Time }
func (*Build) LogfileContent ¶
type Config ¶
type Config struct { Workdir string Logdir string Staticdir string Tmpldir string Server struct { Host string BaseURL string TLScert string TLSkey string } Webhook struct { Secret string } Notification struct { StatusAPI struct { URL string Token string } Email struct { SmtpHost string SmtpUser string SmtpPass string SmtpAuth string From string } } Queues []Queue DefaultQueues []string `yaml:"default_queues"` }
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func (*Controller) Serve ¶
func (c *Controller) Serve()
type GitPushEventData ¶
type GitPushEventData struct { Branch string `json:"ref"` Repository struct { Name string `json:"name"` FullName string `json:"full_name"` HTMLURL string `json:"html_url"` StatusURL string `json:"statuses_url"` CloneURL string `json:"clone_url"` } `json:"repository"` Commits []struct { CommitID string `json:"id"` Message string `json:"message"` URL string `json:"url"` Author struct { Name string `json:"name"` EMail string `json:"email"` Username string `json:"username"` } `json:"author"` Added []string `json:"added"` Removed []string `json:"removed"` Modified []string `json:"modified"` } `json:"commits"` }
func (*GitPushEventData) ShortBranch ¶
func (d *GitPushEventData) ShortBranch() string
type HmacAuthConfig ¶
type HmacAuthConfig struct { // Skipper defines a function to skip middleware. Skipper middleware.Skipper // Validator is a function to validate HmacAuth hash. // Required. Validator HmacAuthValidator // Secret is a string that contains the secret to build the hash. Secret string }
HmacAuthConfig defines the config for HmacAuth middleware.
type HmacAuthValidator ¶
HmacAuthValidator defines a function to validate HmacAuth credentials.
type Job ¶
type Job struct { ID string Port string Startdate time.Time Enddate time.Time Build map[string]*Build PushEvent GitPushEventData CommitIdx int BaseURL string Nonce string }
func (*Job) JobRuntime ¶
func (*Job) ShortCommitID ¶
func (*Job) ShortCommitMessage ¶
func (*Job) StatusOverall ¶
Click to show internal directories.
Click to hide internal directories.