Documentation ¶
Index ¶
- func Reconcile(g ConfigRepoInterface, logger log.Logger, prefix string, ...) error
- type AllConfigRepos
- type ConfigRepo
- type ConfigRepoInterface
- type GoCD
- func (g *GoCD) CreateConfigRepo(repo *github.Repository, prefix string) (ConfigRepo, error)
- func (g *GoCD) DeleteConfigRepo(repo *ConfigRepo, prefix string) (*http.Response, error)
- func (g *GoCD) GetConfigRepo(repo *github.Repository, prefix string) (ConfigRepo, error)
- func (g *GoCD) GetConfigRepos() ([]ConfigRepo, error)
- func (g *GoCD) NewRequest(verb string, path string, headers http.Header, body io.Reader) (*http.Request, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Reconcile ¶
func Reconcile(g ConfigRepoInterface, logger log.Logger, prefix string, gocdRepos []ConfigRepo, ghRepos []*github.Repository) error
Reconcile ensures that repos that have been removed from Github, or are no longer found when they had the topic to match removed, are also removed from GoCD
Types ¶
type AllConfigRepos ¶
type AllConfigRepos struct { Links map[string]map[string]string `json:"_links,omitempty"` Embedded map[string][]ConfigRepo `json:"_embedded,omitempty"` }
AllConfigRepos contains the response from GoCD containing all config repos
type ConfigRepo ¶
type ConfigRepo struct { Links map[string]map[string]string `json:"_links,omitempty"` ID string `json:"id"` PluginID string `json:"plugin_id"` Material repoMaterial `json:"material"` Configuration []interface{} `json:"configuration,omitempty"` }
ConfigRepo is a representation of a GoCD config repo
type ConfigRepoInterface ¶
type ConfigRepoInterface interface { GetConfigRepos() ([]ConfigRepo, error) GetConfigRepo(*github.Repository, string) (ConfigRepo, error) CreateConfigRepo(*github.Repository, string) (ConfigRepo, error) DeleteConfigRepo(*ConfigRepo, string) (*http.Response, error) }
ConfigRepoInterface provides implementations that interact with GoCD
type GoCD ¶
type GoCD struct { URL string User string Password string // contains filtered or unexported fields }
GoCD provides GoCD funcs
func (*GoCD) CreateConfigRepo ¶
func (g *GoCD) CreateConfigRepo(repo *github.Repository, prefix string) (ConfigRepo, error)
CreateConfigRepo creates a previously non-existent config repo
func (*GoCD) DeleteConfigRepo ¶
DeleteConfigRepo removes a config repo from GoCD
func (*GoCD) GetConfigRepo ¶
func (g *GoCD) GetConfigRepo(repo *github.Repository, prefix string) (ConfigRepo, error)
GetConfigRepo retrieves an existing config repo
func (*GoCD) GetConfigRepos ¶
func (g *GoCD) GetConfigRepos() ([]ConfigRepo, error)
GetConfigRepos populates the GoCD struct with config repos
Click to show internal directories.
Click to hide internal directories.