app

package
v1.60.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsFetch added in v1.45.0

func IsFetch(err error) bool

IsFetch asserts fetchError.

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func IsInvalidType added in v1.45.0

func IsInvalidType(err error) bool

IsInvalidType asserts invalidTypeError.

func IsNoMatch added in v1.28.0

func IsNoMatch(err error) bool

IsNoMatch asserts noMatchError.

func IsNoResources

func IsNoResources(err error) bool

IsNoResources asserts noResourcesError.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound asserts notFoundError.

Types

type App added in v1.28.0

type App struct {
	CR *applicationv1alpha1.App
}

App abstracts away the custom resource so it can be returned as a runtime object or a typed custom resource.

func (*App) Object added in v1.28.0

func (a *App) Object() runtime.Object

type Collection added in v1.28.0

type Collection struct {
	Items []App
}

Collection wraps a list of apps.

func (*Collection) Object added in v1.28.0

func (cc *Collection) Object() runtime.Object

type Config

type Config struct {
	Client *client.Client
}

Config represent the input parameters that New takes to produce a valid app getter Service.

type FakeService added in v1.45.0

type FakeService struct {
	// contains filtered or unexported fields
}

func NewFakeService added in v1.45.0

func NewFakeService(storage []runtime.Object) *FakeService

func (*FakeService) Get added in v1.45.0

func (fs *FakeService) Get(ctx context.Context, options GetOptions) (Resource, error)

func (*FakeService) Patch added in v1.45.0

func (fs *FakeService) Patch(ctx context.Context, options PatchOptions) error

type GetOptions

type GetOptions struct {
	LabelSelector string
	Name          string
	Namespace     string
}

GetOptions are the parameters that the Get method takes.

type Interface

type Interface interface {
	Get(context.Context, GetOptions) (Resource, error)
	Patch(context.Context, PatchOptions) error
}

Interface represents the contract for the app data service. Using this instead of a regular 'struct' makes mocking the service in tests much simpler.

func New

func New(config Config) (Interface, error)

New returns a new app getter Service.

type PatchOptions added in v1.45.0

type PatchOptions struct {
	Name      string
	Namespace string
	Version   string
}

PatchOptions are the parameters that the Patch method takes.

type Resource added in v1.28.0

type Resource interface {
	Object() runtime.Object
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service is the object we'll hang the app getter methods on.

func (*Service) Get

func (s *Service) Get(ctx context.Context, options GetOptions) (Resource, error)

Get fetches a list of app CRs filtered by namespace and optionally by name.

func (*Service) Patch added in v1.45.0

func (s *Service) Patch(ctx context.Context, options PatchOptions) error

Patch patches an app CR given its name and namespace.

Jump to

Keyboard shortcuts

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