Documentation ¶
Index ¶
- func CreateAsyncResponse() (string, []byte)
- func GenReqID() string
- func MustParseIPNet(str string) *types.IPNet
- func TestAddItem(s api.CountableListSpec, validData interface{})
- func TestClearItems(s api.CountableListSpec)
- func TestDeepCopyObject(s api.Object, nilSpec api.Object)
- func TestGetGroup(s api.Spec, name string)
- func TestGetItems(s api.ListSpec, items interface{})
- func TestGetMaxLimit(s api.CountableListSpec, limit int32)
- func TestGetName(s api.Spec, name string)
- func TestGetPathMethod(spec api.Spec, action api.Action, matchMethod string, matchPath string)
- func TestGetPathMethodForCountableList(spec api.CountableListSpec, listPath string)
- func TestGetPathMethodForList(spec api.ListSpec, listPath string)
- func TestGetPathMethodForSpec(spec api.Spec, createPath, getPath string)
- func TestLen(s api.ListSpec, num int)
- type ResponseSpec
- type TestClient
- func (n *TestClient) Apply(ctx context.Context, s api.Spec, body interface{}) (string, error)
- func (n *TestClient) Cancel(ctx context.Context, s api.Spec) (string, error)
- func (n *TestClient) Count(ctx context.Context, s api.CountableListSpec, keywords api.SearchParams) (string, error)
- func (n *TestClient) Create(ctx context.Context, s api.Spec, body interface{}) (string, error)
- func (n *TestClient) Delete(ctx context.Context, s api.Spec) (string, error)
- func (n *TestClient) List(ctx context.Context, s api.ListSpec, keywords api.SearchParams) (string, error)
- func (n *TestClient) ListAll(ctx context.Context, s api.CountableListSpec, keywords api.SearchParams) (string, error)
- func (n *TestClient) Read(ctx context.Context, s api.Spec) (string, error)
- func (n *TestClient) RoundTrip(req *http.Request) (*http.Response, error)
- func (n *TestClient) SetRoundTripper(rt http.RoundTripper)
- func (n *TestClient) Update(ctx context.Context, s api.Spec, body interface{}) (string, error)
- func (n *TestClient) WatchList(ctx context.Context, interval time.Duration, s api.ListSpec, ...) error
- func (n *TestClient) WatchListAll(ctx context.Context, interval time.Duration, s api.CountableListSpec, ...) error
- func (n *TestClient) WatchRead(ctx context.Context, interval time.Duration, s api.Spec) error
- type TestSpec
- type TestSpecCountableList
- type TestSpecList
- func (c *TestSpecList) AddItem(v interface{}) bool
- func (c *TestSpecList) ClearItems()
- func (t *TestSpecList) DeepCopyObject() api.Object
- func (t *TestSpecList) GetGroup() string
- func (t *TestSpecList) GetItems() interface{}
- func (c *TestSpecList) GetMaxLimit() int32
- func (t *TestSpecList) GetName() string
- func (t *TestSpecList) GetPathMethod(action api.Action) (string, string)
- func (c *TestSpecList) Index(i int) interface{}
- func (t *TestSpecList) Init()
- func (c *TestSpecList) Len() int
- func (t *TestSpecList) SetPathParams(args ...interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAsyncResponse ¶ added in v0.5.0
func TestAddItem ¶ added in v0.5.0
func TestAddItem(s api.CountableListSpec, validData interface{})
func TestClearItems ¶ added in v0.5.0
func TestClearItems(s api.CountableListSpec)
func TestDeepCopyObject ¶ added in v0.5.0
for api.Object
func TestGetGroup ¶ added in v0.5.0
func TestGetMaxLimit ¶ added in v0.5.0
func TestGetMaxLimit(s api.CountableListSpec, limit int32)
api.CountableListSpec
func TestGetName ¶ added in v0.5.0
func TestGetPathMethod ¶ added in v0.5.0
for api.Spec
func TestGetPathMethodForCountableList ¶ added in v0.5.0
func TestGetPathMethodForCountableList(spec api.CountableListSpec, listPath string)
func TestGetPathMethodForList ¶ added in v0.5.0
func TestGetPathMethodForSpec ¶ added in v0.5.0
Types ¶
type ResponseSpec ¶
type ResponseSpec struct { Code int Spec api.Spec Err *api.BadResponse }
type TestClient ¶ added in v0.5.0
type TestClient struct { Client api.ClientInterface Transport *httpmock.MockTransport RequestHeaders map[string]http.Header RequestBody map[string]string ReadFunc func(s api.Spec) (requestID string, err error) ListFunc func(s api.ListSpec, keywords api.SearchParams) (requestID string, err error) ListAllFunc func(s api.CountableListSpec, keywords api.SearchParams) (requestID string, err error) CountFunc func(s api.CountableListSpec, keywords api.SearchParams) (requestID string, err error) UpdateFunc func(s api.Spec, body interface{}) (requestID string, err error) CreateFunc func(s api.Spec, body interface{}) (requestID string, err error) ApplyFunc func(s api.Spec, body interface{}) (requestID string, err error) DeleteFunc func(s api.Spec) (requestID string, err error) CancelFunc func(s api.Spec) (requestID string, err error) WatchReadFunc func(ctx context.Context, interval time.Duration, s api.Spec) error WatchListFunc func(ctx context.Context, interval time.Duration, s api.ListSpec, keyword api.SearchParams) error WatchListAllFunc func(ctx context.Context, interval time.Duration, s api.CountableListSpec, keyword api.SearchParams) error }
func NewTestClient ¶ added in v0.5.0
func NewTestClient(token, endpoint string, logger api.Logger) *TestClient
func (*TestClient) Count ¶ added in v0.5.0
func (n *TestClient) Count(ctx context.Context, s api.CountableListSpec, keywords api.SearchParams) (string, error)
func (*TestClient) List ¶ added in v0.5.0
func (n *TestClient) List(ctx context.Context, s api.ListSpec, keywords api.SearchParams) (string, error)
func (*TestClient) ListAll ¶ added in v0.5.0
func (n *TestClient) ListAll(ctx context.Context, s api.CountableListSpec, keywords api.SearchParams) (string, error)
func (*TestClient) SetRoundTripper ¶ added in v0.9.0
func (n *TestClient) SetRoundTripper(rt http.RoundTripper)
func (*TestClient) WatchList ¶ added in v0.5.0
func (n *TestClient) WatchList(ctx context.Context, interval time.Duration, s api.ListSpec, keyword api.SearchParams) error
func (*TestClient) WatchListAll ¶ added in v0.5.0
func (n *TestClient) WatchListAll(ctx context.Context, interval time.Duration, s api.CountableListSpec, keyword api.SearchParams) error
type TestSpec ¶ added in v0.5.0
type TestSpec struct { ID string `read:"id"` Name string `read:"name" update:"name" create:"name" apply:"name"` Number int64 `read:"number" update:"number" create:"number" apply:"number"` }
func (*TestSpec) DeepCopyObject ¶ added in v0.5.0
func (*TestSpec) DeepCopyTestSpec ¶ added in v0.5.0
func (*TestSpec) GetPathMethod ¶ added in v0.5.0
func (*TestSpec) SetPathParams ¶ added in v0.6.0
type TestSpecCountableList ¶ added in v0.5.0
type TestSpecCountableList struct { api.Count TestSpecList }
func (*TestSpecCountableList) DeepCopyObject ¶ added in v0.5.0
func (t *TestSpecCountableList) DeepCopyObject() api.Object
func (*TestSpecCountableList) GetPathMethod ¶ added in v0.5.0
func (t *TestSpecCountableList) GetPathMethod(action api.Action) (string, string)
type TestSpecList ¶ added in v0.5.0
type TestSpecList struct {
Items []TestSpec `read:"items"`
}
func (*TestSpecList) AddItem ¶ added in v0.5.0
func (c *TestSpecList) AddItem(v interface{}) bool
func (*TestSpecList) ClearItems ¶ added in v0.5.0
func (c *TestSpecList) ClearItems()
func (*TestSpecList) DeepCopyObject ¶ added in v0.5.0
func (t *TestSpecList) DeepCopyObject() api.Object
func (*TestSpecList) GetGroup ¶ added in v0.5.0
func (t *TestSpecList) GetGroup() string
func (*TestSpecList) GetItems ¶ added in v0.5.0
func (t *TestSpecList) GetItems() interface{}
func (*TestSpecList) GetMaxLimit ¶ added in v0.5.0
func (c *TestSpecList) GetMaxLimit() int32
func (*TestSpecList) GetName ¶ added in v0.5.0
func (t *TestSpecList) GetName() string
func (*TestSpecList) GetPathMethod ¶ added in v0.5.0
func (t *TestSpecList) GetPathMethod(action api.Action) (string, string)
func (*TestSpecList) Index ¶ added in v0.5.0
func (c *TestSpecList) Index(i int) interface{}
func (*TestSpecList) Init ¶ added in v0.5.0
func (t *TestSpecList) Init()
func (*TestSpecList) Len ¶ added in v0.5.0
func (c *TestSpecList) Len() int
func (*TestSpecList) SetPathParams ¶ added in v0.6.0
func (t *TestSpecList) SetPathParams(args ...interface{}) error
Click to show internal directories.
Click to hide internal directories.