Documentation ¶
Index ¶
- type Client
- type ClientMock
- func (mmGet *ClientMock) Get(path string, rw io.Writer) (err error)
- func (mmGet *ClientMock) GetAfterCounter() uint64
- func (mmGet *ClientMock) GetBeforeCounter() uint64
- func (m *ClientMock) MinimockFinish()
- func (m *ClientMock) MinimockGetDone() bool
- func (m *ClientMock) MinimockGetInspect()
- func (m *ClientMock) MinimockPostDone() bool
- func (m *ClientMock) MinimockPostInspect()
- func (m *ClientMock) MinimockWait(timeout mm_time.Duration)
- func (mmPost *ClientMock) Post(path string, body io.Reader, rw io.Writer) (err error)
- func (mmPost *ClientMock) PostAfterCounter() uint64
- func (mmPost *ClientMock) PostBeforeCounter() uint64
- type ClientMockGetExpectation
- type ClientMockGetParams
- type ClientMockGetResults
- type ClientMockPostExpectation
- type ClientMockPostParams
- type ClientMockPostResults
- type Options
- type ReqMods
- type ReqModsResp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { Get(path string, rw io.Writer) error Post(path string, body io.Reader, rw io.Writer) error }
A Client is used to make requests to any one of a group of registry services working together.
type ClientMock ¶
type ClientMock struct { GetMock mClientMockGet PostMock mClientMockPost // contains filtered or unexported fields }
ClientMock implements Client
func NewClientMock ¶
func NewClientMock(t minimock.Tester) *ClientMock
NewClientMock returns a mock for Client
func (*ClientMock) Get ¶
func (mmGet *ClientMock) Get(path string, rw io.Writer) (err error)
Get implements Client
func (*ClientMock) GetAfterCounter ¶
func (mmGet *ClientMock) GetAfterCounter() uint64
GetAfterCounter returns a count of finished ClientMock.Get invocations
func (*ClientMock) GetBeforeCounter ¶
func (mmGet *ClientMock) GetBeforeCounter() uint64
GetBeforeCounter returns a count of ClientMock.Get invocations
func (*ClientMock) MinimockFinish ¶
func (m *ClientMock) MinimockFinish()
MinimockFinish checks that all mocked methods have been called the expected number of times
func (*ClientMock) MinimockGetDone ¶
func (m *ClientMock) MinimockGetDone() bool
MinimockGetDone returns true if the count of the Get invocations corresponds the number of defined expectations
func (*ClientMock) MinimockGetInspect ¶
func (m *ClientMock) MinimockGetInspect()
MinimockGetInspect logs each unmet expectation
func (*ClientMock) MinimockPostDone ¶
func (m *ClientMock) MinimockPostDone() bool
MinimockPostDone returns true if the count of the Post invocations corresponds the number of defined expectations
func (*ClientMock) MinimockPostInspect ¶
func (m *ClientMock) MinimockPostInspect()
MinimockPostInspect logs each unmet expectation
func (*ClientMock) MinimockWait ¶
func (m *ClientMock) MinimockWait(timeout mm_time.Duration)
MinimockWait waits for all mocked methods to be called the expected number of times
func (*ClientMock) PostAfterCounter ¶
func (mmPost *ClientMock) PostAfterCounter() uint64
PostAfterCounter returns a count of finished ClientMock.Post invocations
func (*ClientMock) PostBeforeCounter ¶
func (mmPost *ClientMock) PostBeforeCounter() uint64
PostBeforeCounter returns a count of ClientMock.Post invocations
type ClientMockGetExpectation ¶
type ClientMockGetExpectation struct { Counter uint64 // contains filtered or unexported fields }
ClientMockGetExpectation specifies expectation struct of the Client.Get
func (*ClientMockGetExpectation) Then ¶
func (e *ClientMockGetExpectation) Then(err error) *ClientMock
Then sets up Client.Get return parameters for the expectation previously defined by the When method
type ClientMockGetParams ¶
type ClientMockGetParams struct {
// contains filtered or unexported fields
}
ClientMockGetParams contains parameters of the Client.Get
type ClientMockGetResults ¶
type ClientMockGetResults struct {
// contains filtered or unexported fields
}
ClientMockGetResults contains results of the Client.Get
type ClientMockPostExpectation ¶
type ClientMockPostExpectation struct { Counter uint64 // contains filtered or unexported fields }
ClientMockPostExpectation specifies expectation struct of the Client.Post
func (*ClientMockPostExpectation) Then ¶
func (e *ClientMockPostExpectation) Then(err error) *ClientMock
Then sets up Client.Post return parameters for the expectation previously defined by the When method
type ClientMockPostParams ¶
type ClientMockPostParams struct {
// contains filtered or unexported fields
}
ClientMockPostParams contains parameters of the Client.Post
type ClientMockPostResults ¶
type ClientMockPostResults struct {
// contains filtered or unexported fields
}
ClientMockPostResults contains results of the Client.Post
type ReqMods ¶
type ReqMods struct {
IDs coordinates.RangeIDs `json:"ids"`
}
ReqMods is the data sent from the proxy to the registry when requesting from the registry a list of modules that the proxy is in need of downloading to its local data-store. When making the request, the proxy sends a list of ranges of serial IDs of the modules it already has contained in its data-store. That way the registry can compare that list of ranges with the set of all modules that are registered, and reply with a list of modules that only contains modules the proxy needs to download.
type ReqModsResp ¶
type ReqModsResp struct {
Mods []coordinates.SerialModule `json:"serials"`
}
ReqModsResp is the response sent from the registry to the proxy when the proxy requests a list of which modules it needs to download. There is no guarantee the proxy will not have already downloaded some of the modules, but given the implementation it should be pretty well optimized to not include duplicates of what is in the proxy store.