Documentation
¶
Index ¶
- type Artifact
- type Build
- type Builds
- type HttpClient
- type MockHttpClient
- type MockHttpClient_Do_Call
- func (_c *MockHttpClient_Do_Call) Return(response *http.Response, err error) *MockHttpClient_Do_Call
- func (_c *MockHttpClient_Do_Call) Run(run func(request *http.Request)) *MockHttpClient_Do_Call
- func (_c *MockHttpClient_Do_Call) RunAndReturn(run func(request *http.Request) (*http.Response, error)) *MockHttpClient_Do_Call
- type MockHttpClient_Expecter
- type MockPortal
- func (_mock *MockPortal) DownloadBuildArtifact(product Product, build Build, file io.Writer) error
- func (_m *MockPortal) EXPECT() *MockPortal_Expecter
- func (_mock *MockPortal) GetBuild(product Product, version string, hash string) (Build, error)
- func (_mock *MockPortal) ListBuilds(product Product) (Builds, error)
- func (_mock *MockPortal) RegisterAPIKey(owner string, organization string, role string, expiresAt time.Time) error
- func (_mock *MockPortal) RevokeAPIKey(key string) error
- type MockPortal_DownloadBuildArtifact_Call
- func (_c *MockPortal_DownloadBuildArtifact_Call) Return(err error) *MockPortal_DownloadBuildArtifact_Call
- func (_c *MockPortal_DownloadBuildArtifact_Call) Run(run func(product Product, build Build, file io.Writer)) *MockPortal_DownloadBuildArtifact_Call
- func (_c *MockPortal_DownloadBuildArtifact_Call) RunAndReturn(run func(product Product, build Build, file io.Writer) error) *MockPortal_DownloadBuildArtifact_Call
- type MockPortal_Expecter
- func (_e *MockPortal_Expecter) DownloadBuildArtifact(product interface{}, build interface{}, file interface{}) *MockPortal_DownloadBuildArtifact_Call
- func (_e *MockPortal_Expecter) GetBuild(product interface{}, version interface{}, hash interface{}) *MockPortal_GetBuild_Call
- func (_e *MockPortal_Expecter) ListBuilds(product interface{}) *MockPortal_ListBuilds_Call
- func (_e *MockPortal_Expecter) RegisterAPIKey(owner interface{}, organization interface{}, role interface{}, ...) *MockPortal_RegisterAPIKey_Call
- func (_e *MockPortal_Expecter) RevokeAPIKey(key interface{}) *MockPortal_RevokeAPIKey_Call
- type MockPortal_GetBuild_Call
- func (_c *MockPortal_GetBuild_Call) Return(build Build, err error) *MockPortal_GetBuild_Call
- func (_c *MockPortal_GetBuild_Call) Run(run func(product Product, version string, hash string)) *MockPortal_GetBuild_Call
- func (_c *MockPortal_GetBuild_Call) RunAndReturn(run func(product Product, version string, hash string) (Build, error)) *MockPortal_GetBuild_Call
- type MockPortal_ListBuilds_Call
- func (_c *MockPortal_ListBuilds_Call) Return(availablePackages Builds, err error) *MockPortal_ListBuilds_Call
- func (_c *MockPortal_ListBuilds_Call) Run(run func(product Product)) *MockPortal_ListBuilds_Call
- func (_c *MockPortal_ListBuilds_Call) RunAndReturn(run func(product Product) (Builds, error)) *MockPortal_ListBuilds_Call
- type MockPortal_RegisterAPIKey_Call
- func (_c *MockPortal_RegisterAPIKey_Call) Return(err error) *MockPortal_RegisterAPIKey_Call
- func (_c *MockPortal_RegisterAPIKey_Call) Run(run func(owner string, organization string, role string, expiresAt time.Time)) *MockPortal_RegisterAPIKey_Call
- func (_c *MockPortal_RegisterAPIKey_Call) RunAndReturn(...) *MockPortal_RegisterAPIKey_Call
- type MockPortal_RevokeAPIKey_Call
- type Portal
- type PortalClient
- func (c *PortalClient) DownloadBuildArtifact(product Product, build Build, file io.Writer) error
- func (c *PortalClient) GetBody(path string) (body []byte, status int, err error)
- func (c *PortalClient) GetBuild(product Product, version string, hash string) (Build, error)
- func (c *PortalClient) HttpRequest(method string, path string, body []byte) (resp *http.Response, err error)
- func (c *PortalClient) ListBuilds(product Product) (availablePackages Builds, err error)
- func (c *PortalClient) RegisterAPIKey(owner string, organization string, role string, expiresAt time.Time) error
- func (c *PortalClient) RevokeAPIKey(key string) error
- type Product
- type WriteCounter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Build ¶
type MockHttpClient ¶
MockHttpClient is an autogenerated mock type for the HttpClient type
func NewMockHttpClient ¶
func NewMockHttpClient(t interface {
mock.TestingT
Cleanup(func())
}) *MockHttpClient
NewMockHttpClient creates a new instance of MockHttpClient. 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 (*MockHttpClient) EXPECT ¶
func (_m *MockHttpClient) EXPECT() *MockHttpClient_Expecter
type MockHttpClient_Do_Call ¶
MockHttpClient_Do_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Do'
func (*MockHttpClient_Do_Call) Return ¶
func (_c *MockHttpClient_Do_Call) Return(response *http.Response, err error) *MockHttpClient_Do_Call
func (*MockHttpClient_Do_Call) Run ¶
func (_c *MockHttpClient_Do_Call) Run(run func(request *http.Request)) *MockHttpClient_Do_Call
func (*MockHttpClient_Do_Call) RunAndReturn ¶
func (_c *MockHttpClient_Do_Call) RunAndReturn(run func(request *http.Request) (*http.Response, error)) *MockHttpClient_Do_Call
type MockHttpClient_Expecter ¶
type MockHttpClient_Expecter struct {
// contains filtered or unexported fields
}
func (*MockHttpClient_Expecter) Do ¶
func (_e *MockHttpClient_Expecter) Do(request interface{}) *MockHttpClient_Do_Call
Do is a helper method to define mock.On call
- request
type MockPortal ¶
MockPortal is an autogenerated mock type for the Portal type
func NewMockPortal ¶
func NewMockPortal(t interface {
mock.TestingT
Cleanup(func())
}) *MockPortal
NewMockPortal creates a new instance of MockPortal. 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 (*MockPortal) DownloadBuildArtifact ¶
DownloadBuildArtifact provides a mock function for the type MockPortal
func (*MockPortal) EXPECT ¶
func (_m *MockPortal) EXPECT() *MockPortal_Expecter
func (*MockPortal) ListBuilds ¶
func (_mock *MockPortal) ListBuilds(product Product) (Builds, error)
ListBuilds provides a mock function for the type MockPortal
func (*MockPortal) RegisterAPIKey ¶
func (_mock *MockPortal) RegisterAPIKey(owner string, organization string, role string, expiresAt time.Time) error
RegisterAPIKey provides a mock function for the type MockPortal
func (*MockPortal) RevokeAPIKey ¶
func (_mock *MockPortal) RevokeAPIKey(key string) error
RevokeAPIKey provides a mock function for the type MockPortal
type MockPortal_DownloadBuildArtifact_Call ¶
MockPortal_DownloadBuildArtifact_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DownloadBuildArtifact'
func (*MockPortal_DownloadBuildArtifact_Call) Return ¶
func (_c *MockPortal_DownloadBuildArtifact_Call) Return(err error) *MockPortal_DownloadBuildArtifact_Call
func (*MockPortal_DownloadBuildArtifact_Call) Run ¶
func (_c *MockPortal_DownloadBuildArtifact_Call) Run(run func(product Product, build Build, file io.Writer)) *MockPortal_DownloadBuildArtifact_Call
func (*MockPortal_DownloadBuildArtifact_Call) RunAndReturn ¶
func (_c *MockPortal_DownloadBuildArtifact_Call) RunAndReturn(run func(product Product, build Build, file io.Writer) error) *MockPortal_DownloadBuildArtifact_Call
type MockPortal_Expecter ¶
type MockPortal_Expecter struct {
// contains filtered or unexported fields
}
func (*MockPortal_Expecter) DownloadBuildArtifact ¶
func (_e *MockPortal_Expecter) DownloadBuildArtifact(product interface{}, build interface{}, file interface{}) *MockPortal_DownloadBuildArtifact_Call
DownloadBuildArtifact is a helper method to define mock.On call
- product
- build
- file
func (*MockPortal_Expecter) GetBuild ¶
func (_e *MockPortal_Expecter) GetBuild(product interface{}, version interface{}, hash interface{}) *MockPortal_GetBuild_Call
GetBuild is a helper method to define mock.On call
- product
- version
- hash
func (*MockPortal_Expecter) ListBuilds ¶
func (_e *MockPortal_Expecter) ListBuilds(product interface{}) *MockPortal_ListBuilds_Call
ListBuilds is a helper method to define mock.On call
- product
func (*MockPortal_Expecter) RegisterAPIKey ¶
func (_e *MockPortal_Expecter) RegisterAPIKey(owner interface{}, organization interface{}, role interface{}, expiresAt interface{}) *MockPortal_RegisterAPIKey_Call
RegisterAPIKey is a helper method to define mock.On call
- owner
- organization
- role
- expiresAt
func (*MockPortal_Expecter) RevokeAPIKey ¶
func (_e *MockPortal_Expecter) RevokeAPIKey(key interface{}) *MockPortal_RevokeAPIKey_Call
RevokeAPIKey is a helper method to define mock.On call
- key
type MockPortal_GetBuild_Call ¶
MockPortal_GetBuild_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBuild'
func (*MockPortal_GetBuild_Call) Return ¶
func (_c *MockPortal_GetBuild_Call) Return(build Build, err error) *MockPortal_GetBuild_Call
func (*MockPortal_GetBuild_Call) Run ¶
func (_c *MockPortal_GetBuild_Call) Run(run func(product Product, version string, hash string)) *MockPortal_GetBuild_Call
func (*MockPortal_GetBuild_Call) RunAndReturn ¶
func (_c *MockPortal_GetBuild_Call) RunAndReturn(run func(product Product, version string, hash string) (Build, error)) *MockPortal_GetBuild_Call
type MockPortal_ListBuilds_Call ¶
MockPortal_ListBuilds_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListBuilds'
func (*MockPortal_ListBuilds_Call) Return ¶
func (_c *MockPortal_ListBuilds_Call) Return(availablePackages Builds, err error) *MockPortal_ListBuilds_Call
func (*MockPortal_ListBuilds_Call) Run ¶
func (_c *MockPortal_ListBuilds_Call) Run(run func(product Product)) *MockPortal_ListBuilds_Call
func (*MockPortal_ListBuilds_Call) RunAndReturn ¶
func (_c *MockPortal_ListBuilds_Call) RunAndReturn(run func(product Product) (Builds, error)) *MockPortal_ListBuilds_Call
type MockPortal_RegisterAPIKey_Call ¶
MockPortal_RegisterAPIKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegisterAPIKey'
func (*MockPortal_RegisterAPIKey_Call) Return ¶
func (_c *MockPortal_RegisterAPIKey_Call) Return(err error) *MockPortal_RegisterAPIKey_Call
func (*MockPortal_RegisterAPIKey_Call) Run ¶
func (_c *MockPortal_RegisterAPIKey_Call) Run(run func(owner string, organization string, role string, expiresAt time.Time)) *MockPortal_RegisterAPIKey_Call
func (*MockPortal_RegisterAPIKey_Call) RunAndReturn ¶
func (_c *MockPortal_RegisterAPIKey_Call) RunAndReturn(run func(owner string, organization string, role string, expiresAt time.Time) error) *MockPortal_RegisterAPIKey_Call
type MockPortal_RevokeAPIKey_Call ¶
MockPortal_RevokeAPIKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RevokeAPIKey'
func (*MockPortal_RevokeAPIKey_Call) Return ¶
func (_c *MockPortal_RevokeAPIKey_Call) Return(err error) *MockPortal_RevokeAPIKey_Call
func (*MockPortal_RevokeAPIKey_Call) Run ¶
func (_c *MockPortal_RevokeAPIKey_Call) Run(run func(key string)) *MockPortal_RevokeAPIKey_Call
func (*MockPortal_RevokeAPIKey_Call) RunAndReturn ¶
func (_c *MockPortal_RevokeAPIKey_Call) RunAndReturn(run func(key string) error) *MockPortal_RevokeAPIKey_Call
type Portal ¶
type Portal interface {
ListBuilds(product Product) (availablePackages Builds, err error)
GetBuild(product Product, version string, hash string) (Build, error)
DownloadBuildArtifact(product Product, build Build, file io.Writer) error
RegisterAPIKey(owner string, organization string, role string, expiresAt time.Time) error
RevokeAPIKey(key string) error
}
type PortalClient ¶
type PortalClient struct {
Env env.Env
HttpClient HttpClient
}
func NewPortalClient ¶
func NewPortalClient() *PortalClient
func (*PortalClient) DownloadBuildArtifact ¶
func (*PortalClient) GetBody ¶
func (c *PortalClient) GetBody(path string) (body []byte, status int, err error)
func (*PortalClient) HttpRequest ¶
func (*PortalClient) ListBuilds ¶
func (c *PortalClient) ListBuilds(product Product) (availablePackages Builds, err error)
func (*PortalClient) RegisterAPIKey ¶
func (*PortalClient) RevokeAPIKey ¶
func (c *PortalClient) RevokeAPIKey(key string) error
type WriteCounter ¶
type WriteCounter struct {
Written int64
LastUpdate time.Time
Writer io.Writer
// contains filtered or unexported fields
}
WriteCounter is a custom io.Writer that counts bytes written and logs progress.
func NewWriteCounter ¶
func NewWriteCounter(writer io.Writer) *WriteCounter
NewWriteCounter creates a new WriteCounter.