capi

package
v0.7.0-rc9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2022 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatePullRequestFromTemplate

func CreatePullRequestFromTemplate(params CreatePullRequestFromTemplateParams, r TemplatePullRequester, w io.Writer) error

CreatePullRequestFromTemplate uses a TemplatePullRequester adapter to create a pull request from a CAPI template.

func GetCredentials

func GetCredentials(r CredentialsRetriever, w io.Writer) error

GetCredentials uses a CredentialsRetriever adapter to show a list of CAPI credentials.

func GetTemplateParameters

func GetTemplateParameters(name string, r TemplatesRetriever, w io.Writer) error

GetTemplateParameters uses a TemplatesRetriever adapter to show a list of parameters for a given template.

func GetTemplateProfiles added in v0.6.1

func GetTemplateProfiles(name string, r TemplatesRetriever, w io.Writer) error

GetTemplateProfiles uses a TemplatesRetriever adapter to show a list of profiles for a given template.

func GetTemplates

func GetTemplates(r TemplatesRetriever, w io.Writer) error

GetTemplates uses a TemplatesRetriever adapter to show a list of templates to the console.

func GetTemplatesByProvider added in v0.3.2

func GetTemplatesByProvider(provider string, r TemplatesRetriever, w io.Writer) error

GetTemplatesByProvider uses a TemplatesRetriever adapter to show a list of templates for a given provider to the console.

func RenderTemplateWithParameters

func RenderTemplateWithParameters(name string, parameters map[string]string, creds Credentials, r TemplateRenderer, w io.Writer) error

RenderTemplate uses a TemplateRenderer adapter to show a template populated with parameter values.

Types

type CreatePullRequestFromTemplateParams

type CreatePullRequestFromTemplateParams struct {
	GitProviderToken string
	TemplateName     string
	ParameterValues  map[string]string
	RepositoryURL    string
	HeadBranch       string
	BaseBranch       string
	Title            string
	Description      string
	CommitMessage    string
	Credentials      Credentials
	ProfileValues    []ProfileValues
}

type Credentials

type Credentials struct {
	Group     string `json:"group"`
	Version   string `json:"version"`
	Kind      string `json:"kind"`
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
}

type CredentialsRetriever

type CredentialsRetriever interface {
	Source() string
	RetrieveCredentials() ([]Credentials, error)
}

CredentialsRetriever defines the interface that adapters need to implement in order to retrieve CAPI credentials.

type HelmRepository added in v0.6.1

type HelmRepository struct {
	Name      string
	Namespace string
}

type Maintainer added in v0.6.1

type Maintainer struct {
	Name  string
	Email string
	Url   string
}

type Profile added in v0.6.1

type Profile struct {
	Name              string
	Home              string
	Sources           []string
	Description       string
	Keywords          []string
	Maintainers       []Maintainer
	Icon              string
	Annotations       map[string]string
	KubeVersion       string
	HelmRepository    HelmRepository
	AvailableVersions []string
}

type ProfileValues added in v0.6.1

type ProfileValues struct {
	Name    string `json:"name"`
	Version string `json:"version"`
	Values  string `json:"values"`
}

type Template

type Template struct {
	Name        string
	Description string
	Provider    string
	Error       string
}

type TemplateParameter

type TemplateParameter struct {
	Name        string
	Description string
	Required    bool
	Options     []string
}

type TemplatePullRequester

type TemplatePullRequester interface {
	CreatePullRequestFromTemplate(params CreatePullRequestFromTemplateParams) (string, error)
}

TemplatePullRequester defines the interface that adapters need to implement in order to create a pull request from a CAPI template. Implementers should return the web URI of the pull request.

type TemplateRenderer

type TemplateRenderer interface {
	RenderTemplateWithParameters(name string, parameters map[string]string, creds Credentials) (string, error)
}

TemplateRenderer defines the interface that adapters need to implement in order to render a template populated with parameter values.

type TemplatesRetriever

type TemplatesRetriever interface {
	Source() string
	RetrieveTemplates() ([]Template, error)
	RetrieveTemplatesByProvider(provider string) ([]Template, error)
	RetrieveTemplateParameters(name string) ([]TemplateParameter, error)
	RetrieveTemplateProfiles(name string) ([]Profile, error)
}

TemplatesRetriever defines the interface that adapters need to implement in order to return an array of templates.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL