Documentation ¶
Index ¶
- Constants
- type AppHandler
- func (h *AppHandler) CreateRoute(cr *v1alpha1.WebApp) *routev1.Route
- func (h *AppHandler) Delete(cr *v1alpha1.WebApp) error
- func (h *AppHandler) GetRuntimeObjs(exts []runtime.RawExtension) ([]runtime.Object, error)
- func (h *AppHandler) Handle(ctx context.Context, event sdk.Event) error
- func (h *AppHandler) IsAppReady(cr *v1alpha1.WebApp) bool
- func (h *AppHandler) ProcessTemplate(cr *v1alpha1.WebApp) ([]runtime.RawExtension, error)
- func (h *AppHandler) ProvisionObjects(objects []runtime.Object, cr *v1alpha1.WebApp) error
- func (h *AppHandler) SetStatus(msg string, cr *v1alpha1.WebApp)
- type ClientFactory
- type Handler
- type Handlers
- type Metrics
- type SdkCruder
- type SdkCruderMock
- func (mock *SdkCruderMock) Create(object sdk.Object) error
- func (mock *SdkCruderMock) CreateCalls() []struct{ ... }
- func (mock *SdkCruderMock) Delete(object sdk.Object, opts ...sdk.DeleteOption) error
- func (mock *SdkCruderMock) DeleteCalls() []struct{ ... }
- func (mock *SdkCruderMock) Get(object sdk.Object, opts ...sdk.GetOption) error
- func (mock *SdkCruderMock) GetCalls() []struct{ ... }
- func (mock *SdkCruderMock) List(namespace string, into sdk.Object, opts ...sdk.ListOption) error
- func (mock *SdkCruderMock) ListCalls() []struct{ ... }
- func (mock *SdkCruderMock) Update(object sdk.Object) error
- func (mock *SdkCruderMock) UpdateCalls() []struct{ ... }
Constants ¶
View Source
const ( WTLocations = "WALKTHROUGH_LOCATIONS" IntegreatlyVersion = "INTEGREATLY_VERSION" ClusterType = "CLUSTER_TYPE" OpenShiftVersion = "OPENSHIFT_VERSION" OpenShiftAPIHost = "OPENSHIFT_API" InstalledServices = "INSTALLED_SERVICES" InstallationType = "INSTALLATION_TYPE" WTLocationsDefault = "https://github.com/integr8ly/tutorial-web-app-walkthroughs#v1.12.3" IntegreatlyVersionDefault = "not set" ClusterTypeDefault = "not set" OpenShiftVersionDefault = "3" OpenShiftAPIHostDefault = "openshift.default.svc" WebAppImage = "quay.io/integreatly/tutorial-web-app:2.28.1" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppHandler ¶
type AppHandler struct {
// contains filtered or unexported fields
}
func NewWebHandler ¶
func NewWebHandler(m *metrics.Metrics, osClient openshift.OSClientInterface, factory ClientFactory, cruder SdkCruder) AppHandler
func (*AppHandler) CreateRoute ¶ added in v0.0.48
func (h *AppHandler) CreateRoute(cr *v1alpha1.WebApp) *routev1.Route
func (*AppHandler) GetRuntimeObjs ¶
func (h *AppHandler) GetRuntimeObjs(exts []runtime.RawExtension) ([]runtime.Object, error)
func (*AppHandler) IsAppReady ¶
func (h *AppHandler) IsAppReady(cr *v1alpha1.WebApp) bool
func (*AppHandler) ProcessTemplate ¶
func (h *AppHandler) ProcessTemplate(cr *v1alpha1.WebApp) ([]runtime.RawExtension, error)
func (*AppHandler) ProvisionObjects ¶
type ClientFactory ¶
type ClientFactory func(apiVersion, kind, namespace string) (dynamic.ResourceInterface, string, error)
type Handler ¶
type Handler interface { Handle(ctx context.Context, event sdk.Event) error Delete(cr *v1alpha1.WebApp) error SetStatus(msg string, cr *v1alpha1.WebApp) ProcessTemplate(cr *v1alpha1.WebApp) ([]runtime.RawExtension, error) GetRuntimeObjs(exts []runtime.RawExtension) ([]runtime.Object, error) ProvisionObjects(objects []runtime.Object, cr *v1alpha1.WebApp) error IsAppReady(cr *v1alpha1.WebApp) bool }
type SdkCruderMock ¶
type SdkCruderMock struct { // CreateFunc mocks the Create method. CreateFunc func(object sdk.Object) error // DeleteFunc mocks the Delete method. DeleteFunc func(object sdk.Object, opts ...sdk.DeleteOption) error // GetFunc mocks the Get method. GetFunc func(object sdk.Object, opts ...sdk.GetOption) error // ListFunc mocks the List method. ListFunc func(namespace string, into sdk.Object, opts ...sdk.ListOption) error // UpdateFunc mocks the Update method. UpdateFunc func(object sdk.Object) error // contains filtered or unexported fields }
SdkCruderMock is a mock implementation of SdkCruder.
func TestSomethingThatUsesSdkCruder(t *testing.T) { // make and configure a mocked SdkCruder mockedSdkCruder := &SdkCruderMock{ CreateFunc: func(object sdk.Object) error { panic("mock out the Create method") }, DeleteFunc: func(object sdk.Object, opts ...sdk.DeleteOption) error { panic("mock out the Delete method") }, GetFunc: func(object sdk.Object, opts ...sdk.GetOption) error { panic("mock out the Get method") }, ListFunc: func(namespace string, into sdk.Object, opts ...sdk.ListOption) error { panic("mock out the List method") }, UpdateFunc: func(object sdk.Object) error { panic("mock out the Update method") }, } // use mockedSdkCruder in code that requires SdkCruder // and then make assertions. }
func (*SdkCruderMock) Create ¶
func (mock *SdkCruderMock) Create(object sdk.Object) error
Create calls CreateFunc.
func (*SdkCruderMock) CreateCalls ¶
func (mock *SdkCruderMock) CreateCalls() []struct { Object sdk.Object }
CreateCalls gets all the calls that were made to Create. Check the length with:
len(mockedSdkCruder.CreateCalls())
func (*SdkCruderMock) Delete ¶
func (mock *SdkCruderMock) Delete(object sdk.Object, opts ...sdk.DeleteOption) error
Delete calls DeleteFunc.
func (*SdkCruderMock) DeleteCalls ¶
func (mock *SdkCruderMock) DeleteCalls() []struct { Object sdk.Object Opts []sdk.DeleteOption }
DeleteCalls gets all the calls that were made to Delete. Check the length with:
len(mockedSdkCruder.DeleteCalls())
func (*SdkCruderMock) GetCalls ¶
func (mock *SdkCruderMock) GetCalls() []struct { Object sdk.Object Opts []sdk.GetOption }
GetCalls gets all the calls that were made to Get. Check the length with:
len(mockedSdkCruder.GetCalls())
func (*SdkCruderMock) List ¶
func (mock *SdkCruderMock) List(namespace string, into sdk.Object, opts ...sdk.ListOption) error
List calls ListFunc.
func (*SdkCruderMock) ListCalls ¶
func (mock *SdkCruderMock) ListCalls() []struct { Namespace string Into sdk.Object Opts []sdk.ListOption }
ListCalls gets all the calls that were made to List. Check the length with:
len(mockedSdkCruder.ListCalls())
func (*SdkCruderMock) Update ¶
func (mock *SdkCruderMock) Update(object sdk.Object) error
Update calls UpdateFunc.
func (*SdkCruderMock) UpdateCalls ¶
func (mock *SdkCruderMock) UpdateCalls() []struct { Object sdk.Object }
UpdateCalls gets all the calls that were made to Update. Check the length with:
len(mockedSdkCruder.UpdateCalls())
Click to show internal directories.
Click to hide internal directories.