core

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 20, 2019 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Overview

package core contains a high level client for interacting with knative primitives used to realise, amongst other things, riff functions. The client typically returns structs for kubernetes resources, as they would have been written "by hand" to be applied by kubectl. It is not the role of the client to deal with printing, formatting or command line parsing.

Index

Constants

View Source
const (
	BuildConfigMapName    = "riff-build"
	DefaultImagePrefixKey = "default-image-prefix"
)
View Source
const BuildServiceAccountName = "riff-build"

Variables

This section is empty.

Functions

func ParseEnvVar added in v0.1.1

func ParseEnvVar(envVars []string) ([]v1.EnvVar, error)

func ParseEnvVarSource added in v0.1.1

func ParseEnvVarSource(envVarsFrom []string) ([]v1.EnvVar, error)

Types

type BuildFunctionOptions added in v0.1.2

type BuildFunctionOptions struct {
	BuildOptions

	Image string
}

type BuildOptions added in v0.3.0

type BuildOptions struct {
	Invoker        string
	Handler        string
	Artifact       string
	LocalPath      string
	BuildpackImage string
	RunImage       string
}

type Builder added in v0.2.0

type Builder interface {
	Build(repoName string, options BuildOptions, log io.Writer) error
}

type Client

type Client interface {
	CreateFunction(builder Builder, options CreateFunctionOptions, log io.Writer) (*serving.Service, *serving.Revision, *corev1.PersistentVolumeClaim, error)
	UpdateFunction(builder Builder, options UpdateFunctionOptions, log io.Writer) error
	BuildFunction(builder Builder, options BuildFunctionOptions, log io.Writer) error

	CreateSubscription(options CreateSubscriptionOptions) (*eventing.Subscription, error)
	DeleteSubscription(options DeleteSubscriptionOptions) error
	ListSubscriptions(options ListSubscriptionsOptions) (*eventing.SubscriptionList, error)

	ListChannels(options ListChannelOptions) (*eventing.ChannelList, error)
	CreateChannel(options CreateChannelOptions) (*eventing.Channel, error)
	DeleteChannel(options DeleteChannelOptions) error

	ListServices(options ListServiceOptions) (*serving.ServiceList, error)
	CreateService(options CreateOrUpdateServiceOptions) (*serving.Service, error)
	UpdateService(options CreateOrUpdateServiceOptions) (*serving.Service, error)
	DeleteService(options DeleteServiceOptions) error
	ServiceStatus(options ServiceStatusOptions) (*duckv1alpha1.Condition, error)
	ServiceCoordinates(options ServiceInvokeOptions) (ingressIP string, hostName string, err error)

	SystemInstall(manifests map[string]*Manifest, options SystemInstallOptions) (bool, error)
	SystemUninstall(options SystemUninstallOptions) (bool, error)

	NamespaceInit(manifests map[string]*Manifest, options NamespaceInitOptions) error
	NamespaceCleanup(options NamespaceCleanupOptions) error

	// helpers
	FetchPackConfig() (*PackConfig, error)
	DefaultBuildImagePrefix(namespace string) (string, error)
	SetDefaultBuildImagePrefix(namespace, prefix string) error
}

func NewClient

func NewClient(clientConfig clientcmd.ClientConfig, kubeClient kubernetes.Interface, eventing eventing_cs.Interface, serving serving_cs.Interface, build build_cs.Interface, kubeCtl kubectl.KubeCtl, kustomizer kustomize.Kustomizer) Client

type CreateChannelOptions

type CreateChannelOptions struct {
	Namespace                 string
	Name                      string
	ClusterChannelProvisioner string
	DryRun                    bool
}

type CreateFunctionOptions

type CreateFunctionOptions struct {
	CreateOrUpdateServiceOptions
	BuildOptions

	GitRepo     string
	GitRevision string
	SubPath     string
}

type CreateOrUpdateServiceOptions added in v0.2.0

type CreateOrUpdateServiceOptions struct {
	Namespace string
	Name      string
	Image     string
	Env       []string
	EnvFrom   []string
	DryRun    bool
	Verbose   bool
	Wait      bool
}

type CreateSubscriptionOptions

type CreateSubscriptionOptions struct {
	Namespace  string
	Name       string
	Channel    string
	Subscriber string
	Reply      string
	DryRun     bool
}

type DeleteChannelOptions

type DeleteChannelOptions struct {
	Namespace string
	Name      string
}

type DeleteServiceOptions

type DeleteServiceOptions struct {
	Namespace string
	Name      string
}

type DeleteSubscriptionOptions added in v0.1.3

type DeleteSubscriptionOptions struct {
	Namespace string
	Name      string
}

type ListChannelOptions

type ListChannelOptions struct {
	Namespace string
}

type ListServiceOptions

type ListServiceOptions struct {
	Namespace string
}

type ListSubscriptionsOptions added in v0.1.3

type ListSubscriptionsOptions struct {
	Namespace string
}

type Manifest added in v0.1.2

type Manifest struct {
	ManifestVersion string   `json:"manifestVersion"`
	Istio           []string `json:"istio"`
	Knative         []string `json:"knative"`
	Namespace       []string `json:"namespace"`
	// contains filtered or unexported fields
}

Manifest defines the location of YAML files for system components.

func NewManifest added in v0.1.2

func NewManifest(path string) (*Manifest, error)

func ResolveManifest added in v0.2.0

func ResolveManifest(manifests map[string]*Manifest, path string) (*Manifest, error)

func (*Manifest) ResourceAbsolutePath added in v0.3.0

func (m *Manifest) ResourceAbsolutePath(path string) (string, error)

ResourceAbsolutePath takes a path to a resource and returns an equivalent absolute path. If the input path is a http(s) URL or is an absolute file path, it is returned without modification. If the input path is a file URL, the corresponding (absolute) file path is returned. If the input path is a relative file path, it is interpreted to be relative to the directory from which the manifest was read (and if the manifest was not read from a directory, an error is returned) and the corresponding absolute file path is returned.

func (*Manifest) VisitResources added in v0.2.0

func (m *Manifest) VisitResources(f func(resource string) error) error

type NamespaceCleanupOptions added in v0.3.0

type NamespaceCleanupOptions struct {
	NamespaceName   string
	SecretName      string
	RemoveNamespace bool
}

type NamespaceInitOptions

type NamespaceInitOptions struct {
	NamespaceName string
	Manifest      string

	ImagePrefix string

	NoSecret     bool
	SecretName   string
	GcrTokenPath string
	DockerHubId  string

	Registry     string
	RegistryUser string
}

type PackConfig added in v0.3.0

type PackConfig struct {
	BuilderImage string
	RunImage     string
}

type ServiceInvokeOptions

type ServiceInvokeOptions struct {
	Namespace       string
	Name            string
	ContentTypeText bool
	ContentTypeJson bool
}

type ServiceStatusOptions

type ServiceStatusOptions struct {
	Namespace string
	Name      string
}

type SystemInstallOptions

type SystemInstallOptions struct {
	Manifest string
	NodePort bool
	Force    bool
}

type SystemUninstallOptions added in v0.1.1

type SystemUninstallOptions struct {
	Istio bool
	Force bool
}

type UpdateFunctionOptions added in v0.2.0

type UpdateFunctionOptions struct {
	Namespace string
	Name      string
	LocalPath string
	Verbose   bool
	Wait      bool
}

type Writer added in v0.1.2

type Writer interface {
	Print(event kail.Event) error
	Fprint(w io.Writer, event kail.Event) error
}

func NewWriter added in v0.1.2

func NewWriter(out io.Writer) Writer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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