Documentation ¶
Index ¶
- Constants
- func GetRecipeCatalogueVersions(recipeName string, catl RecipeCatalogue) ([]string, error)
- func GetRecipesLocal() ([]string, error)
- func GetStringInBetween(recipeName, str, start, end string) (result string, err 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
- func (r Recipe) ChaosVersion() (string, error)
- func (r Recipe) Ensure(chaos bool, offline bool) error
- func (r Recipe) EnsureExists() error
- func (r Recipe) EnsureIsClean() error
- func (r Recipe) EnsureLatest() error
- func (r Recipe) EnsureUpToDate() error
- func (r Recipe) EnsureVersion(version string) (bool, error)
- func (r Recipe) GetComposeConfig(env map[string]string) (*composetypes.Config, error)
- func (r Recipe) GetComposeFiles(appEnv map[string]string) ([]string, error)
- func (r Recipe) GetRecipeVersions() (RecipeVersions, error)
- func (r Recipe) GetReleaseNotes(version string) (string, error)
- func (r Recipe) GetVersionLabelLocal() (string, error)
- func (r Recipe) Head() (*plumbing.Reference, error)
- func (r Recipe) Push(dryRun bool) error
- func (r Recipe) SampleEnv() (map[string]string, error)
- func (r Recipe) Tags() ([]string, error)
- func (r Recipe) UpdateLabel(pattern, serviceName, label string) error
- func (r Recipe) UpdateTag(image, tag string) (bool, error)
- 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 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 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 Version string Dir string GitURL string SSHURL string ComposePath string ReadmePath string SampleEnvPath string AbraShPath string }
func (Recipe) ChaosVersion ¶
ChaosVersion constructs a chaos mode recipe version.
func (Recipe) Ensure ¶
Ensure makes sure the recipe exists, is up to date and has the latest version checked out.
func (Recipe) EnsureExists ¶
EnsureExists ensures that the recipe is locally cloned
func (Recipe) EnsureIsClean ¶
EnsureIsClean makes sure that the recipe repository has no unstaged changes.
func (Recipe) EnsureLatest ¶
EnsureLatest makes sure the latest commit is checked out for the local recipe repository
func (Recipe) EnsureUpToDate ¶
EnsureUpToDate ensures that the local repo is synced to the remote
func (Recipe) EnsureVersion ¶
EnsureVersion checks whether a specific version exists for a recipe.
func (Recipe) GetComposeConfig ¶
func (Recipe) GetComposeFiles ¶
GetComposeFiles gets the list of compose files for an app (or recipe if you don't already have an app) which should be merged into a composetypes.Config while respecting the COMPOSE_FILE env var.
func (Recipe) GetRecipeVersions ¶
func (r Recipe) GetRecipeVersions() (RecipeVersions, error)
GetRecipeVersions retrieves all recipe versions.
func (Recipe) GetReleaseNotes ¶
GetReleaseNotes prints release notes for the recipe version
func (Recipe) GetVersionLabelLocal ¶
GetVersionLabelLocal retrieves the version label on the local recipe config
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 label in-place on file system local compose files.
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.
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.