operations

package
v0.0.0-...-fa6c17c Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstallProfile

func InstallProfile(ctx context.Context, path string, options *InstallOptions) error

InstallProfile will generate the HelmRelease for a profile.

TODO: could this take a git.Repository?

Types

type Client

type Client interface {
	FileContents(ctx context.Context, repo, path, ref string) ([]byte, error)
}

Client implementations access git hosts to fetch files.

func RawGitHubClientFactory

func RawGitHubClientFactory(repoURL string) (Client, error)

RawGitHubClientFactory is a very simple client that only supports fetching via github.com (and only unauthenticated requests).

type ClientError

type ClientError struct {
	StatusCode int
	Message    string
}

ClientError is an error from Client implementations.

func NewClientError

func NewClientError(code int, message string) ClientError

NewClientError creates and returns a new Git client error.

func (ClientError) Error

func (c ClientError) Error() string

type ClientFactory

type ClientFactory func(repoURL string) (Client, error)

ClientFactory implementations should return a Client interface ready to be used to access the provided repoURL.

var DefaultClientFactory ClientFactory = RawGitHubClientFactory

DefaultClientFactory is the default client factory implementation.

type InstallOptions

type InstallOptions struct {
	*profiles.ProfileOptions
	NewBranchName string
}

InstallOptions are passed to the install operation to provide information for bootstrappign resources.

type RawGitHubClient

type RawGitHubClient struct {
	*http.Client
}

RawGitHubClient is a very naive client that fetches files via raw.githubusercontent.com, without authentication.

func NewRawGitHubClient

func NewRawGitHubClient(c *http.Client) *RawGitHubClient

NewRawGitHubClient returns an implementation of the client that can fetch using the raw GitHub access.

This will not work for authenticated requests, or anything other than GitHub.

func (RawGitHubClient) FileContents

func (c RawGitHubClient) FileContents(ctx context.Context, repo, path, ref string) ([]byte, error)

FileContents implements the Client interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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