Documentation
¶
Index ¶
- func QueryString(r *http.Request, s string) string
- type BitbucketCloudConfiguration
- type BitbucketServerConfiguration
- type Configuration
- type GerritServerConfiguration
- type GithubServerConfiguration
- type GitlabServerConfiguration
- type ServerConfiguration
- type Service
- func (s *Service) ApplyConfiguration(config interface{}) error
- func (s *Service) CheckConfiguration(config interface{}) error
- func (s *Service) Init(config interface{}) (cdsclient.ServiceConfig, error)
- func (s *Service) SearchPullRequestHandler() service.Handler
- func (s *Service) Serve(c context.Context) error
- func (s *Service) Status(ctx context.Context) *sdk.MonitoringStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BitbucketCloudConfiguration ¶
type BitbucketCloudConfiguration struct {
ClientID string `toml:"clientId" json:"-" default:"xxxxx" comment:"Bitbucket cloud OAuth Application Client ID"`
ClientSecret string `toml:"clientSecret" json:"-" default:"xxxxx" comment:"Bitbucket Cloud OAuth Application Client Secret"`
Status struct {
Disable bool `` /* 141-byte string literal not displayed */
ShowDetail bool `` /* 159-byte string literal not displayed */
}
DisableWebHooks bool `toml:"disableWebHooks" comment:"Does webhooks are supported by VCS Server" json:"disable_web_hook"`
// DisablePolling bool `toml:"disablePolling" comment:"Does polling is supported by VCS Server" json:"disable_polling"`
ProxyWebhook string `` /* 272-byte string literal not displayed */
}
BitbucketCloudConfiguration represents the bitbucket configuration
type BitbucketServerConfiguration ¶
type BitbucketServerConfiguration struct {
ConsumerKey string `toml:"consumerKey" json:"-" default:"xxxxx" comment:"You can change the consumeKey if you want"`
PrivateKey string `toml:"privateKey" json:"-" default:"xxxxx"`
Status struct {
Disable bool `` /* 141-byte string literal not displayed */
}
DisableWebHooks bool `toml:"disableWebHooks" comment:"Does webhooks are supported by VCS Server" json:"disable_web_hook"`
DisablePolling bool `toml:"disablePolling" comment:"Does polling is supported by VCS Server" json:"disable_polling"`
ProxyWebhook string `` /* 272-byte string literal not displayed */
Username string `` /* 171-byte string literal not displayed */
Token string `` /* 164-byte string literal not displayed */
}
BitbucketServerConfiguration represents the bitbucket configuration
type Configuration ¶
type Configuration struct {
Name string `toml:"name" comment:"Name of this CDS VCS Service\n Enter a name to enable this service" json:"name"`
HTTP service.HTTPRouterConfiguration `toml:"http" comment:"######################\n CDS VCS HTTP Configuration \n######################" json:"http"`
URL string `default:"http://localhost:8084" json:"url"`
API service.APIServiceConfiguration `toml:"api" comment:"######################\n CDS API Settings \n######################" json:"api"`
Cache struct {
TTL int `toml:"ttl" default:"60" json:"ttl"`
Redis struct {
Host string `` /* 192-byte string literal not displayed */
Password string `toml:"password" json:"-"`
DbIndex int `toml:"dbindex" default:"0" json:"dbindex"`
} `toml:"redis" json:"redis"`
} `toml:"cache" comment:"######################\n CDS VCS Cache Settings \n######################" json:"cache"`
ProxyWebhook string `` /* 272-byte string literal not displayed */
Servers map[string]ServerConfiguration `toml:"servers" comment:"######################\n CDS VCS Server Settings \n######################" json:"servers"`
}
Configuration is the vcs configuration structure
type GerritServerConfiguration ¶
type GerritServerConfiguration struct {
Status struct {
Disable bool `` /* 141-byte string literal not displayed */
ShowDetail bool `` /* 159-byte string literal not displayed */
} `json:"status"`
DisableGerritEvent bool `toml:"disableGerritEvent" comment:"Does gerrit event stream are supported by VCS Server" json:"disable_gerrit_event"`
SSHPort int `toml:"sshport" default:"" commented:"true" comment:"SSH port of gerrit, example: 29418" json:"ssh_port"`
EventStream struct {
User string `toml:"user" default:"" commented:"true" comment:"User to access to gerrit event stream" json:"user"`
PrivateKey string `toml:"privateKey" default:"" commented:"true" comment:"Private key of the user who access to gerrit event stream" json:"-"`
} `json:"event_stream"`
Reviewer struct {
User string `toml:"user" default:"" commented:"true" comment:"User that review changes" json:"user"`
Token string `toml:"token" default:"" commented:"true" comment:"Token of the reviewer" json:"-"`
} `json:"reviewer"`
}
GerritServerConfiguration represents the gerrit configuration
type GithubServerConfiguration ¶
type GithubServerConfiguration struct {
ClientID string `toml:"clientId" json:"-" default:"xxxxx" comment:"GitHub OAuth Application Client ID"`
ClientSecret string `toml:"clientSecret" json:"-" default:"xxxxx" comment:"GitHub OAuth Application Client Secret"`
APIURL string `toml:"apiUrl" json:"-" default:"https://api.github.com" comment:"The URL for the GitHub API."`
Status struct {
Disable bool `` /* 141-byte string literal not displayed */
ShowDetail bool `` /* 159-byte string literal not displayed */
}
DisableWebHooks bool `toml:"disableWebHooks" comment:"Does webhooks are supported by VCS Server" json:"disable_web_hook"`
DisablePolling bool `toml:"disablePolling" comment:"Does polling is supported by VCS Server" json:"disable_polling"`
ProxyWebhook string `` /* 272-byte string literal not displayed */
Username string `` /* 168-byte string literal not displayed */
Token string `` /* 161-byte string literal not displayed */
}
GithubServerConfiguration represents the github configuration
type GitlabServerConfiguration ¶
type GitlabServerConfiguration struct {
AppID string `toml:"appId" json:"-" default:"xxxxx" comment:"GitLab Application ID"`
Secret string `toml:"secret" json:"-" default:"xxxxx" comment:"GitLab Application Secret"`
CallbackURL string `` /* 154-byte string literal not displayed */
Status struct {
Disable bool `` /* 141-byte string literal not displayed */
ShowDetail bool `` /* 159-byte string literal not displayed */
}
DisableWebHooks bool `toml:"disableWebHooks" comment:"Does webhooks are supported by VCS Server" json:"disable_web_hook"`
DisablePolling bool `toml:"disablePolling" comment:"Does polling is supported by VCS Server" json:"disable_polling"`
ProxyWebhook string `` /* 272-byte string literal not displayed */
}
GitlabServerConfiguration represents the gitlab configuration
type ServerConfiguration ¶
type ServerConfiguration struct {
URL string `toml:"url" comment:"URL of this VCS Server" json:"url"`
Github *GithubServerConfiguration `` /* 178-byte string literal not displayed */
Gitlab *GitlabServerConfiguration `` /* 178-byte string literal not displayed */
Bitbucket *BitbucketServerConfiguration `` /* 171-byte string literal not displayed */
BitbucketCloud *BitbucketCloudConfiguration `` /* 185-byte string literal not displayed */
Gerrit *GerritServerConfiguration `` /* 152-byte string literal not displayed */
}
ServerConfiguration is the configuration for a VCS server
type Service ¶
type Service struct {
service.Common
Cfg Configuration
Router *api.Router
Cache cache.Store
UI struct {
HTTP struct {
URL string
}
}
}
Service is the stuct representing a vcs µService
func (*Service) ApplyConfiguration ¶
ApplyConfiguration apply an object of type hooks.Configuration after checking it
func (*Service) CheckConfiguration ¶
CheckConfiguration checks the validity of the configuration object
func (*Service) SearchPullRequestHandler ¶ added in v0.53.0
Click to show internal directories.
Click to hide internal directories.