...

Package project

Overview ▾

Package project provides functions to create, delete, list, check existence of and get machine readable description of projects, and to get and set the current project. A project is represented either by a `project.project.openshift.io` resource (in OpenShift) or by a `namespace` in Kubernetes.

Package project is a generated GoMock package.

Constants

const ProjectKind = "Project"

type Client

type Client interface {
    SetCurrent(projectName string) error
    Create(projectName string, wait bool) error
    Delete(projectName string, wait bool) error
    List() (ProjectList, error)
    Exists(projectName string) (bool, error)
}

func NewClient

func NewClient(client kclient.ClientInterface) Client

type MockClient

MockClient is a mock of Client interface.

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

func NewMockClient

func NewMockClient(ctrl *gomock.Controller) *MockClient

NewMockClient creates a new mock instance.

func (*MockClient) Create

func (m *MockClient) Create(projectName string, wait bool) error

Create mocks base method.

func (*MockClient) Delete

func (m *MockClient) Delete(projectName string, wait bool) error

Delete mocks base method.

func (*MockClient) EXPECT

func (m *MockClient) EXPECT() *MockClientMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockClient) Exists

func (m *MockClient) Exists(projectName string) (bool, error)

Exists mocks base method.

func (*MockClient) List

func (m *MockClient) List() (ProjectList, error)

List mocks base method.

func (*MockClient) SetCurrent

func (m *MockClient) SetCurrent(projectName string) error

SetCurrent mocks base method.

type MockClientMockRecorder

MockClientMockRecorder is the mock recorder for MockClient.

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

func (*MockClientMockRecorder) Create

func (mr *MockClientMockRecorder) Create(projectName, wait interface{}) *gomock.Call

Create indicates an expected call of Create.

func (*MockClientMockRecorder) Delete

func (mr *MockClientMockRecorder) Delete(projectName, wait interface{}) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockClientMockRecorder) Exists

func (mr *MockClientMockRecorder) Exists(projectName interface{}) *gomock.Call

Exists indicates an expected call of Exists.

func (*MockClientMockRecorder) List

func (mr *MockClientMockRecorder) List() *gomock.Call

List indicates an expected call of List.

func (*MockClientMockRecorder) SetCurrent

func (mr *MockClientMockRecorder) SetCurrent(projectName interface{}) *gomock.Call

SetCurrent indicates an expected call of SetCurrent.

type Project

type Project struct {
    metav1.TypeMeta   `json:",inline"`
    metav1.ObjectMeta `json:"metadata,omitempty"`
    Status            Status `json:"status,omitempty"`
}

func NewProject

func NewProject(projectName string, isActive bool) Project

NewProject creates and returns a new project instance

type ProjectList

type ProjectList struct {
    metav1.TypeMeta `json:",inline"`
    metav1.ListMeta `json:"metadata,omitempty"`
    Items           []Project `json:"items"`
}

func NewProjectList

func NewProjectList(items []Project) ProjectList

NewProjectList returns an instance of a list containing the `items` projects

type Status

type Status struct {
    Active bool `json:"active"`
}