Documentation
¶
Index ¶
- Variables
- type Foo
- func (*Foo) Descriptor() ([]byte, []int)deprecated
- func (x *Foo) GetListFoos() []*NestedFoo
- func (x *Foo) GetMapFoos() map[string]*NestedFoo
- func (x *Foo) GetState() State
- func (x *Foo) GetText() string
- func (*Foo) ProtoMessage()
- func (x *Foo) ProtoReflect() protoreflect.Message
- func (x *Foo) Reset()
- func (x *Foo) String() string
- type MockTestClient
- func (_mock *MockTestClient) Convert(r *TestResponse) ([]string, *TestCreate, *TestUpdate, error)
- func (_mock *MockTestClient) Create(rq *TestCreate) (*TestResponse, error)
- func (_mock *MockTestClient) Delete(id string) (*TestResponse, error)
- func (_m *MockTestClient) EXPECT() *MockTestClient_Expecter
- func (_mock *MockTestClient) Get(id string) (*TestResponse, error)
- func (_mock *MockTestClient) List() ([]*TestResponse, error)
- func (_mock *MockTestClient) Update(rq *TestUpdate) (*TestResponse, error)
- type MockTestClient_Convert_Call
- func (_c *MockTestClient_Convert_Call) Return(strings []string, testCreate *TestCreate, testUpdate *TestUpdate, err error) *MockTestClient_Convert_Call
- func (_c *MockTestClient_Convert_Call) Run(run func(r *TestResponse)) *MockTestClient_Convert_Call
- func (_c *MockTestClient_Convert_Call) RunAndReturn(run func(r *TestResponse) ([]string, *TestCreate, *TestUpdate, error)) *MockTestClient_Convert_Call
- type MockTestClient_Create_Call
- func (_c *MockTestClient_Create_Call) Return(testResponse *TestResponse, err error) *MockTestClient_Create_Call
- func (_c *MockTestClient_Create_Call) Run(run func(rq *TestCreate)) *MockTestClient_Create_Call
- func (_c *MockTestClient_Create_Call) RunAndReturn(run func(rq *TestCreate) (*TestResponse, error)) *MockTestClient_Create_Call
- type MockTestClient_Delete_Call
- func (_c *MockTestClient_Delete_Call) Return(testResponse *TestResponse, err error) *MockTestClient_Delete_Call
- func (_c *MockTestClient_Delete_Call) Run(run func(id string)) *MockTestClient_Delete_Call
- func (_c *MockTestClient_Delete_Call) RunAndReturn(run func(id string) (*TestResponse, error)) *MockTestClient_Delete_Call
- type MockTestClient_Expecter
- func (_e *MockTestClient_Expecter) Convert(r any) *MockTestClient_Convert_Call
- func (_e *MockTestClient_Expecter) Create(rq any) *MockTestClient_Create_Call
- func (_e *MockTestClient_Expecter) Delete(id any) *MockTestClient_Delete_Call
- func (_e *MockTestClient_Expecter) Get(id any) *MockTestClient_Get_Call
- func (_e *MockTestClient_Expecter) List() *MockTestClient_List_Call
- func (_e *MockTestClient_Expecter) Update(rq any) *MockTestClient_Update_Call
- type MockTestClient_Get_Call
- func (_c *MockTestClient_Get_Call) Return(testResponse *TestResponse, err error) *MockTestClient_Get_Call
- func (_c *MockTestClient_Get_Call) Run(run func(id string)) *MockTestClient_Get_Call
- func (_c *MockTestClient_Get_Call) RunAndReturn(run func(id string) (*TestResponse, error)) *MockTestClient_Get_Call
- type MockTestClient_List_Call
- func (_c *MockTestClient_List_Call) Return(testResponses []*TestResponse, err error) *MockTestClient_List_Call
- func (_c *MockTestClient_List_Call) Run(run func()) *MockTestClient_List_Call
- func (_c *MockTestClient_List_Call) RunAndReturn(run func() ([]*TestResponse, error)) *MockTestClient_List_Call
- type MockTestClient_Update_Call
- func (_c *MockTestClient_Update_Call) Return(testResponse *TestResponse, err error) *MockTestClient_Update_Call
- func (_c *MockTestClient_Update_Call) Run(run func(rq *TestUpdate)) *MockTestClient_Update_Call
- func (_c *MockTestClient_Update_Call) RunAndReturn(run func(rq *TestUpdate) (*TestResponse, error)) *MockTestClient_Update_Call
- type NestedFoo
- type ProtoTestCRUD
- func (m *ProtoTestCRUD) Convert(r *Foo) ([]string, *Foo, *Foo, error)
- func (m *ProtoTestCRUD) Create(rq *Foo) (*Foo, error)
- func (m *ProtoTestCRUD) Delete(ids ...string) (*Foo, error)
- func (m *ProtoTestCRUD) Get(ids ...string) (*Foo, error)
- func (m *ProtoTestCRUD) List() ([]*Foo, error)
- func (m *ProtoTestCRUD) Update(rq *Foo) (*Foo, error)
- type State
- type TestCRUD
- func (t TestCRUD) Convert(r *TestResponse) ([]string, *TestCreate, *TestUpdate, error)
- func (t TestCRUD) Create(rq *TestCreate) (*TestResponse, error)
- func (t TestCRUD) Delete(ids ...string) (*TestResponse, error)
- func (t TestCRUD) Get(ids ...string) (*TestResponse, error)
- func (t TestCRUD) List() ([]*TestResponse, error)
- func (t TestCRUD) Update(rq *TestUpdate) (*TestResponse, error)
- type TestClient
- type TestCreate
- type TestResponse
- type TestUpdate
Constants ¶
This section is empty.
Variables ¶
var ( State_name = map[int32]string{ 0: "STATE_UNSPECIFIED", 1: "STATE_PENDING", 2: "STATE_ACTIVE", 3: "STATE_TERMINATED", } State_value = map[string]int32{ "STATE_UNSPECIFIED": 0, "STATE_PENDING": 1, "STATE_ACTIVE": 2, "STATE_TERMINATED": 3, } )
Enum value maps for State.
var File_pkg_genericcli_printers_proto_test_test_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Foo ¶
type Foo struct {
Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
State State `protobuf:"varint,2,opt,name=state,proto3,enum=printers_test.State" json:"state,omitempty"`
ListFoos []*NestedFoo `protobuf:"bytes,3,rep,name=list_foos,json=listFoos,proto3" json:"list_foos,omitempty"`
MapFoos map[string]*NestedFoo `` /* 156-byte string literal not displayed */
// contains filtered or unexported fields
}
func (*Foo) Descriptor
deprecated
func (*Foo) GetListFoos ¶
func (*Foo) GetMapFoos ¶
func (*Foo) ProtoMessage ¶
func (*Foo) ProtoMessage()
func (*Foo) ProtoReflect ¶
func (x *Foo) ProtoReflect() protoreflect.Message
type MockTestClient ¶
MockTestClient is an autogenerated mock type for the TestClient type
func NewMockTestClient ¶
func NewMockTestClient(t interface {
mock.TestingT
Cleanup(func())
}) *MockTestClient
NewMockTestClient creates a new instance of MockTestClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockTestClient) Convert ¶
func (_mock *MockTestClient) Convert(r *TestResponse) ([]string, *TestCreate, *TestUpdate, error)
Convert provides a mock function for the type MockTestClient
func (*MockTestClient) Create ¶
func (_mock *MockTestClient) Create(rq *TestCreate) (*TestResponse, error)
Create provides a mock function for the type MockTestClient
func (*MockTestClient) Delete ¶
func (_mock *MockTestClient) Delete(id string) (*TestResponse, error)
Delete provides a mock function for the type MockTestClient
func (*MockTestClient) EXPECT ¶
func (_m *MockTestClient) EXPECT() *MockTestClient_Expecter
func (*MockTestClient) Get ¶
func (_mock *MockTestClient) Get(id string) (*TestResponse, error)
Get provides a mock function for the type MockTestClient
func (*MockTestClient) List ¶
func (_mock *MockTestClient) List() ([]*TestResponse, error)
List provides a mock function for the type MockTestClient
func (*MockTestClient) Update ¶
func (_mock *MockTestClient) Update(rq *TestUpdate) (*TestResponse, error)
Update provides a mock function for the type MockTestClient
type MockTestClient_Convert_Call ¶
MockTestClient_Convert_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Convert'
func (*MockTestClient_Convert_Call) Return ¶
func (_c *MockTestClient_Convert_Call) Return(strings []string, testCreate *TestCreate, testUpdate *TestUpdate, err error) *MockTestClient_Convert_Call
func (*MockTestClient_Convert_Call) Run ¶
func (_c *MockTestClient_Convert_Call) Run(run func(r *TestResponse)) *MockTestClient_Convert_Call
func (*MockTestClient_Convert_Call) RunAndReturn ¶
func (_c *MockTestClient_Convert_Call) RunAndReturn(run func(r *TestResponse) ([]string, *TestCreate, *TestUpdate, error)) *MockTestClient_Convert_Call
type MockTestClient_Create_Call ¶
MockTestClient_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create'
func (*MockTestClient_Create_Call) Return ¶
func (_c *MockTestClient_Create_Call) Return(testResponse *TestResponse, err error) *MockTestClient_Create_Call
func (*MockTestClient_Create_Call) Run ¶
func (_c *MockTestClient_Create_Call) Run(run func(rq *TestCreate)) *MockTestClient_Create_Call
func (*MockTestClient_Create_Call) RunAndReturn ¶
func (_c *MockTestClient_Create_Call) RunAndReturn(run func(rq *TestCreate) (*TestResponse, error)) *MockTestClient_Create_Call
type MockTestClient_Delete_Call ¶
MockTestClient_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete'
func (*MockTestClient_Delete_Call) Return ¶
func (_c *MockTestClient_Delete_Call) Return(testResponse *TestResponse, err error) *MockTestClient_Delete_Call
func (*MockTestClient_Delete_Call) Run ¶
func (_c *MockTestClient_Delete_Call) Run(run func(id string)) *MockTestClient_Delete_Call
func (*MockTestClient_Delete_Call) RunAndReturn ¶
func (_c *MockTestClient_Delete_Call) RunAndReturn(run func(id string) (*TestResponse, error)) *MockTestClient_Delete_Call
type MockTestClient_Expecter ¶
type MockTestClient_Expecter struct {
// contains filtered or unexported fields
}
func (*MockTestClient_Expecter) Convert ¶
func (_e *MockTestClient_Expecter) Convert(r any) *MockTestClient_Convert_Call
Convert is a helper method to define mock.On call
- r *TestResponse
func (*MockTestClient_Expecter) Create ¶
func (_e *MockTestClient_Expecter) Create(rq any) *MockTestClient_Create_Call
Create is a helper method to define mock.On call
- rq *TestCreate
func (*MockTestClient_Expecter) Delete ¶
func (_e *MockTestClient_Expecter) Delete(id any) *MockTestClient_Delete_Call
Delete is a helper method to define mock.On call
- id string
func (*MockTestClient_Expecter) Get ¶
func (_e *MockTestClient_Expecter) Get(id any) *MockTestClient_Get_Call
Get is a helper method to define mock.On call
- id string
func (*MockTestClient_Expecter) List ¶
func (_e *MockTestClient_Expecter) List() *MockTestClient_List_Call
List is a helper method to define mock.On call
func (*MockTestClient_Expecter) Update ¶
func (_e *MockTestClient_Expecter) Update(rq any) *MockTestClient_Update_Call
Update is a helper method to define mock.On call
- rq *TestUpdate
type MockTestClient_Get_Call ¶
MockTestClient_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'
func (*MockTestClient_Get_Call) Return ¶
func (_c *MockTestClient_Get_Call) Return(testResponse *TestResponse, err error) *MockTestClient_Get_Call
func (*MockTestClient_Get_Call) Run ¶
func (_c *MockTestClient_Get_Call) Run(run func(id string)) *MockTestClient_Get_Call
func (*MockTestClient_Get_Call) RunAndReturn ¶
func (_c *MockTestClient_Get_Call) RunAndReturn(run func(id string) (*TestResponse, error)) *MockTestClient_Get_Call
type MockTestClient_List_Call ¶
MockTestClient_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List'
func (*MockTestClient_List_Call) Return ¶
func (_c *MockTestClient_List_Call) Return(testResponses []*TestResponse, err error) *MockTestClient_List_Call
func (*MockTestClient_List_Call) Run ¶
func (_c *MockTestClient_List_Call) Run(run func()) *MockTestClient_List_Call
func (*MockTestClient_List_Call) RunAndReturn ¶
func (_c *MockTestClient_List_Call) RunAndReturn(run func() ([]*TestResponse, error)) *MockTestClient_List_Call
type MockTestClient_Update_Call ¶
MockTestClient_Update_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Update'
func (*MockTestClient_Update_Call) Return ¶
func (_c *MockTestClient_Update_Call) Return(testResponse *TestResponse, err error) *MockTestClient_Update_Call
func (*MockTestClient_Update_Call) Run ¶
func (_c *MockTestClient_Update_Call) Run(run func(rq *TestUpdate)) *MockTestClient_Update_Call
func (*MockTestClient_Update_Call) RunAndReturn ¶
func (_c *MockTestClient_Update_Call) RunAndReturn(run func(rq *TestUpdate) (*TestResponse, error)) *MockTestClient_Update_Call
type NestedFoo ¶
type NestedFoo struct {
Text []string `protobuf:"bytes,1,rep,name=text,proto3" json:"text,omitempty"`
// contains filtered or unexported fields
}
func (*NestedFoo) Descriptor
deprecated
func (*NestedFoo) ProtoMessage ¶
func (*NestedFoo) ProtoMessage()
func (*NestedFoo) ProtoReflect ¶
func (x *NestedFoo) ProtoReflect() protoreflect.Message
type ProtoTestCRUD ¶
type ProtoTestCRUD struct {
Foo *Foo
}
ProtoTestCRUD can be used for tests using MultiArgGenericCLI.
func (*ProtoTestCRUD) List ¶
func (m *ProtoTestCRUD) List() ([]*Foo, error)
type State ¶
type State int32
func (State) Descriptor ¶
func (State) Descriptor() protoreflect.EnumDescriptor
func (State) EnumDescriptor
deprecated
func (State) Number ¶
func (x State) Number() protoreflect.EnumNumber
func (State) Type ¶
func (State) Type() protoreflect.EnumType
type TestCRUD ¶
type TestCRUD struct {
// contains filtered or unexported fields
}
func NewTestCRUD ¶
func NewTestCRUD(client TestClient) *TestCRUD
func (TestCRUD) Convert ¶
func (t TestCRUD) Convert(r *TestResponse) ([]string, *TestCreate, *TestUpdate, error)
func (TestCRUD) Create ¶
func (t TestCRUD) Create(rq *TestCreate) (*TestResponse, error)
func (TestCRUD) List ¶
func (t TestCRUD) List() ([]*TestResponse, error)
func (TestCRUD) Update ¶
func (t TestCRUD) Update(rq *TestUpdate) (*TestResponse, error)
type TestClient ¶
type TestClient interface {
Get(id string) (*TestResponse, error)
List() ([]*TestResponse, error)
Create(rq *TestCreate) (*TestResponse, error)
Update(rq *TestUpdate) (*TestResponse, error)
Delete(id string) (*TestResponse, error)
Convert(r *TestResponse) ([]string, *TestCreate, *TestUpdate, error)
}