Documentation ¶
Index ¶
- Constants
- func ChaosVersion(recipeName string) (string, error)
- func Ensure(recipeName string) error
- func EnsureExists(recipeName string) error
- func EnsureIsClean(recipeName string) error
- func EnsureLatest(recipeName string) error
- func EnsureUpToDate(recipeName string) error
- func EnsureVersion(recipeName, version string) error
- func GetRecipeCatalogueVersions(recipeName string, catl RecipeCatalogue) ([]string, error)
- func GetRecipesLocal() ([]string, error)
- func GetStringInBetween(recipeName, str, start, end string) (result string, err error)
- func GetVersionLabelLocal(recipe Recipe) (string, error)
- func UpdateRepositories(repos RepoCatalogue, recipeName string) error
- func VersionsOfService(recipe, serviceName string, offline bool) ([]string, error)
- type ByRecipeName
- type Features
- type Image
- type InternalTracker
- type Name
- type Owner
- type Permissions
- type Recipe
- type RecipeCatalogue
- type RecipeMeta
- type RecipeMissingFromCatalogue
- type RecipeVersions
- type RepoCatalogue
- type RepoMeta
- type ServiceMeta
- type TopicMeta
Constants ¶
const RecipeCatalogueURL = "https://recipes.coopcloud.tech/recipes.json"
RecipeCatalogueURL is the only current recipe catalogue available.
const ReposMetadataURL = "https://git.coopcloud.tech/api/v1/orgs/coop-cloud/repos"
ReposMetadataURL is the recipe repository metadata.
Variables ¶
This section is empty.
Functions ¶
func ChaosVersion ¶
ChaosVersion constructs a chaos mode recipe version.
func Ensure ¶
Ensure makes sure the recipe exists, is up to date and has the latest version checked out.
func EnsureExists ¶
EnsureExists ensures that a recipe is locally cloned
func EnsureIsClean ¶
EnsureIsClean makes sure that the recipe repository has no unstaged changes.
func EnsureLatest ¶
EnsureLatest makes sure the latest commit is checked out for a local recipe repository
func EnsureUpToDate ¶
EnsureUpToDate ensures that the local repo is synced to the remote
func EnsureVersion ¶
EnsureVersion checks whether a specific version exists for a recipe.
func GetRecipeCatalogueVersions ¶
func GetRecipeCatalogueVersions(recipeName string, catl RecipeCatalogue) ([]string, error)
GetRecipeCatalogueVersions list the recipe versions listed in the recipe catalogue.
func GetRecipesLocal ¶
GetRecipesLocal retrieves all local recipe directories
func GetStringInBetween ¶
GetStringInBetween returns empty string if no start or end string found
func GetVersionLabelLocal ¶
GetVersionLabelLocal retrieves the version label on the local recipe config
func UpdateRepositories ¶
func UpdateRepositories(repos RepoCatalogue, recipeName string) error
UpdateRepositories clones and updates all recipe repositories locally.
Types ¶
type ByRecipeName ¶
type ByRecipeName []RecipeMeta
ByRecipeName sorts recipes by name.
func (ByRecipeName) Len ¶
func (r ByRecipeName) Len() int
func (ByRecipeName) Less ¶
func (r ByRecipeName) Less(i, j int) bool
func (ByRecipeName) Swap ¶
func (r ByRecipeName) Swap(i, j int)
type Features ¶
type Features struct { Backups string `json:"backups"` Email string `json:"email"` Healthcheck string `json:"healthcheck"` Image Image `json:"image"` Status int `json:"status"` Tests string `json:"tests"` SSO string `json:"sso"` }
Features represent what top-level features a recipe supports (e.g. does this recipe support backups?).
type Image ¶
type Image struct { Image string `json:"image"` Rating string `json:"rating"` Source string `json:"source"` URL string `json:"url"` }
Image represents a recipe container image.
func GetImageMetadata ¶
type InternalTracker ¶
type InternalTracker struct { EnableTimeTracker bool `json:"enable_time_tracker"` AllowOnlyContributorsToTrackTime bool `json:"allow_only_contributors_to_track_time"` EnableIssuesDependencies bool `json:"enable_issue_dependencies"` }
InternalTracker is issue tracker metadata for a repo.
type Owner ¶
type Owner struct { ID int `json:"id"` Login string `json:"login"` FullName string `json:"full_name"` Email string `json:"email"` AvatarURL string `json:"avatar_url"` Language string `json:"language"` IsAdmin bool `json:"is_admin"` LastLogin string `json:"last_login"` Created string `json:"created"` Restricted bool `json:"restricted"` Username string `json:"username"` }
Owner is the repo organisation owner metadata.
type Permissions ¶
type Permissions struct { Admin bool `json:"admin"` Push bool `json:"push"` Pull bool `json:"pull"` }
Permissions is perms metadata for a repo.
type Recipe ¶
type Recipe struct { Name string Config *composetypes.Config Meta RecipeMeta }
Recipe represents a recipe.
func (Recipe) Push ¶
Push pushes the latest changes to a SSH URL remote. You need to have your local SSH configuration for git.coopcloud.tech working for this to work
func (Recipe) UpdateLabel ¶
UpdateLabel updates a recipe label
type RecipeCatalogue ¶
type RecipeCatalogue map[Name]RecipeMeta
RecipeCatalogue represents the entire recipe catalogue.
func ReadRecipeCatalogue ¶
func ReadRecipeCatalogue(offline bool) (RecipeCatalogue, error)
ReadRecipeCatalogue reads the recipe catalogue.
func (RecipeCatalogue) Flatten ¶
func (r RecipeCatalogue) Flatten() []RecipeMeta
Flatten converts AppCatalogue to slice
type RecipeMeta ¶
type RecipeMeta struct { Category string `json:"category"` DefaultBranch string `json:"default_branch"` Description string `json:"description"` Features Features `json:"features"` Icon string `json:"icon"` Name string `json:"name"` Repository string `json:"repository"` SSHURL string `json:"ssh_url"` Versions RecipeVersions `json:"versions"` Website string `json:"website"` }
RecipeMeta represents metadata for a recipe in the abra catalogue.
func GetRecipeMeta ¶
func GetRecipeMeta(recipeName string, offline bool) (RecipeMeta, error)
GetRecipeMeta retrieves the recipe metadata from the recipe catalogue.
func (RecipeMeta) LatestVersion ¶
func (r RecipeMeta) LatestVersion() string
LatestVersion returns the latest version of a recipe.
type RecipeMissingFromCatalogue ¶
type RecipeMissingFromCatalogue struct {
// contains filtered or unexported fields
}
RecipeMissingFromCatalogue signifies a recipe is not present in the catalogue.
func (RecipeMissingFromCatalogue) Error ¶
func (r RecipeMissingFromCatalogue) Error() string
Error outputs the error message.
type RecipeVersions ¶
type RecipeVersions []map[tag]map[service]ServiceMeta
RecipeVersions are the versions associated with a recipe.
func GetRecipeVersions ¶
func GetRecipeVersions(recipeName string, offline bool) (RecipeVersions, error)
GetRecipeVersions retrieves all recipe versions.
type RepoCatalogue ¶
RepoCatalogue represents all the recipe repo metadata.
func ReadReposMetadata ¶
func ReadReposMetadata() (RepoCatalogue, error)
ReadReposMetadata retrieves coop-cloud/... repo metadata from Gitea.
type RepoMeta ¶
type RepoMeta struct { ID int `json:"id"` Owner Owner Name string `json:"name"` FullName string `json:"full_name"` Description string `json:"description"` Empty bool `json:"empty"` Private bool `json:"private"` Fork bool `json:"fork"` Template bool `json:"template"` Parent interface{} `json:"parent"` Mirror bool `json:"mirror"` Size int `json:"size"` HTMLURL string `json:"html_url"` SSHURL string `json:"ssh_url"` CloneURL string `json:"clone_url"` OriginalURL string `json:"original_url"` Website string `json:"website"` StarsCount int `json:"stars_count"` ForksCount int `json:"forks_count"` WatchersCount int `json:"watchers_count"` OpenIssuesCount int `json:"open_issues_count"` OpenPRCount int `json:"open_pr_counter"` ReleaseCounter int `json:"release_counter"` DefaultBranch string `json:"default_branch"` Archived bool `json:"archived"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` Permissions Permissions HasIssues bool `json:"has_issues"` InternalTracker InternalTracker HasWiki bool `json:"has_wiki"` HasPullRequests bool `json:"has_pull_requests"` HasProjects bool `json:"has_projects"` IgnoreWhitespaceConflicts bool `json:"ignore_whitespace_conflicts"` AllowMergeCommits bool `json:"allow_merge_commits"` AllowRebase bool `json:"allow_rebase"` AllowRebaseExplicit bool `json:"allow_rebase_explicit"` AllowSquashMerge bool `json:"allow_squash_merge"` AvatarURL string `json:"avatar_url"` Internal bool `json:"internal"` MirrorInterval string `json:"mirror_interval"` }
RepoMeta is a single recipe repo metadata.
type ServiceMeta ¶
ServiceMeta represents meta info associated with a service.