Documentation
¶
Index ¶
- type ApiKey
- type Artifact
- type Build
- type Builds
- type Http
- type HttpClient
- type HttpWrapper
- type MockHttp
- 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 MockHttp_Download_Call
- func (_c *MockHttp_Download_Call) Return(err error) *MockHttp_Download_Call
- func (_c *MockHttp_Download_Call) Run(run func(url string, file io.Writer, quiet bool)) *MockHttp_Download_Call
- func (_c *MockHttp_Download_Call) RunAndReturn(run func(url string, file io.Writer, quiet bool) error) *MockHttp_Download_Call
- type MockHttp_Expecter
- type MockHttp_Get_Call
- type MockHttp_Request_Call
- func (_c *MockHttp_Request_Call) Return(responseBody []byte, err error) *MockHttp_Request_Call
- func (_c *MockHttp_Request_Call) Run(run func(url string, method string, body io.Reader)) *MockHttp_Request_Call
- func (_c *MockHttp_Request_Call) RunAndReturn(run func(url string, method string, body io.Reader) ([]byte, error)) *MockHttp_Request_Call
- type MockPortal
- func (_mock *MockPortal) DownloadBuildArtifact(product Product, build Build, file io.Writer, startByte int, quiet bool) error
- func (_m *MockPortal) EXPECT() *MockPortal_Expecter
- func (_mock *MockPortal) GetApiKeyId(oldKey string) (string, error)
- func (_mock *MockPortal) GetBuild(product Product, version string, hash string) (Build, error)
- func (_mock *MockPortal) ListAPIKeys() ([]ApiKey, error)
- func (_mock *MockPortal) ListBuilds(product Product) (Builds, error)
- func (_mock *MockPortal) RegisterAPIKey(owner string, organization string, role string, expiresAt time.Time) (*ApiKey, error)
- func (_mock *MockPortal) RevokeAPIKey(key string) error
- func (_mock *MockPortal) UpdateAPIKey(key string, expiresAt time.Time) error
- func (_mock *MockPortal) VerifyBuildArtifactDownload(file io.Reader, download Build) error
- type MockPortal_DownloadBuildArtifact_Call
- func (_c *MockPortal_DownloadBuildArtifact_Call) Return(err error) *MockPortal_DownloadBuildArtifact_Call
- func (_c *MockPortal_DownloadBuildArtifact_Call) Run(...) *MockPortal_DownloadBuildArtifact_Call
- func (_c *MockPortal_DownloadBuildArtifact_Call) RunAndReturn(...) *MockPortal_DownloadBuildArtifact_Call
- type MockPortal_Expecter
- func (_e *MockPortal_Expecter) DownloadBuildArtifact(product interface{}, build interface{}, file interface{}, ...) *MockPortal_DownloadBuildArtifact_Call
- func (_e *MockPortal_Expecter) GetApiKeyId(oldKey interface{}) *MockPortal_GetApiKeyId_Call
- func (_e *MockPortal_Expecter) GetBuild(product interface{}, version interface{}, hash interface{}) *MockPortal_GetBuild_Call
- func (_e *MockPortal_Expecter) ListAPIKeys() *MockPortal_ListAPIKeys_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
- func (_e *MockPortal_Expecter) UpdateAPIKey(key interface{}, expiresAt interface{}) *MockPortal_UpdateAPIKey_Call
- func (_e *MockPortal_Expecter) VerifyBuildArtifactDownload(file interface{}, download interface{}) *MockPortal_VerifyBuildArtifactDownload_Call
- type MockPortal_GetApiKeyId_Call
- func (_c *MockPortal_GetApiKeyId_Call) Return(s string, err error) *MockPortal_GetApiKeyId_Call
- func (_c *MockPortal_GetApiKeyId_Call) Run(run func(oldKey string)) *MockPortal_GetApiKeyId_Call
- func (_c *MockPortal_GetApiKeyId_Call) RunAndReturn(run func(oldKey string) (string, error)) *MockPortal_GetApiKeyId_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_ListAPIKeys_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(apiKey *ApiKey, 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 MockPortal_UpdateAPIKey_Call
- func (_c *MockPortal_UpdateAPIKey_Call) Return(err error) *MockPortal_UpdateAPIKey_Call
- func (_c *MockPortal_UpdateAPIKey_Call) Run(run func(key string, expiresAt time.Time)) *MockPortal_UpdateAPIKey_Call
- func (_c *MockPortal_UpdateAPIKey_Call) RunAndReturn(run func(key string, expiresAt time.Time) error) *MockPortal_UpdateAPIKey_Call
- type MockPortal_VerifyBuildArtifactDownload_Call
- func (_c *MockPortal_VerifyBuildArtifactDownload_Call) Return(err error) *MockPortal_VerifyBuildArtifactDownload_Call
- func (_c *MockPortal_VerifyBuildArtifactDownload_Call) Run(run func(file io.Reader, download Build)) *MockPortal_VerifyBuildArtifactDownload_Call
- func (_c *MockPortal_VerifyBuildArtifactDownload_Call) RunAndReturn(run func(file io.Reader, download Build) error) *MockPortal_VerifyBuildArtifactDownload_Call
- type Portal
- type PortalClient
- func (c *PortalClient) AuthorizedHttpRequest(req *http.Request) (resp *http.Response, err error)
- func (c *PortalClient) DownloadBuildArtifact(product Product, build Build, file io.Writer, startByte int, quiet bool) error
- func (c *PortalClient) GetApiKeyId(oldKey string) (string, 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) ListAPIKeys() ([]ApiKey, error)
- func (c *PortalClient) ListBuilds(product Product) (availablePackages Builds, err error)
- func (c *PortalClient) RegisterAPIKey(owner string, organization string, role string, expiresAt time.Time) (*ApiKey, error)
- func (c *PortalClient) RevokeAPIKey(keyId string) error
- func (c *PortalClient) UpdateAPIKey(key string, expiresAt time.Time) error
- func (c *PortalClient) VerifyBuildArtifactDownload(file io.Reader, download Build) error
- type Product
- type WriteCounter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Build ¶
type HttpWrapper ¶ added in v0.17.0
type HttpWrapper struct {
HttpClient HttpClient
}
func NewHttpWrapper ¶ added in v0.17.0
func NewHttpWrapper() *HttpWrapper
type MockHttp ¶ added in v0.17.0
MockHttp is an autogenerated mock type for the Http type
func NewMockHttp ¶ added in v0.17.0
NewMockHttp creates a new instance of MockHttp. 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 (*MockHttp) Download ¶ added in v0.17.0
Download provides a mock function for the type MockHttp
func (*MockHttp) EXPECT ¶ added in v0.17.0
func (_m *MockHttp) EXPECT() *MockHttp_Expecter
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 *http.Request
type MockHttp_Download_Call ¶ added in v0.17.0
MockHttp_Download_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Download'
func (*MockHttp_Download_Call) Return ¶ added in v0.17.0
func (_c *MockHttp_Download_Call) Return(err error) *MockHttp_Download_Call
func (*MockHttp_Download_Call) Run ¶ added in v0.17.0
func (_c *MockHttp_Download_Call) Run(run func(url string, file io.Writer, quiet bool)) *MockHttp_Download_Call
func (*MockHttp_Download_Call) RunAndReturn ¶ added in v0.17.0
func (_c *MockHttp_Download_Call) RunAndReturn(run func(url string, file io.Writer, quiet bool) error) *MockHttp_Download_Call
type MockHttp_Expecter ¶ added in v0.17.0
type MockHttp_Expecter struct {
// contains filtered or unexported fields
}
func (*MockHttp_Expecter) Download ¶ added in v0.17.0
func (_e *MockHttp_Expecter) Download(url interface{}, file interface{}, quiet interface{}) *MockHttp_Download_Call
Download is a helper method to define mock.On call
- url string
- file io.Writer
- quiet bool
func (*MockHttp_Expecter) Get ¶ added in v0.17.0
func (_e *MockHttp_Expecter) Get(url interface{}) *MockHttp_Get_Call
Get is a helper method to define mock.On call
- url string
func (*MockHttp_Expecter) Request ¶ added in v0.17.0
func (_e *MockHttp_Expecter) Request(url interface{}, method interface{}, body interface{}) *MockHttp_Request_Call
Request is a helper method to define mock.On call
- url string
- method string
- body io.Reader
type MockHttp_Get_Call ¶ added in v0.17.0
MockHttp_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'
func (*MockHttp_Get_Call) Return ¶ added in v0.17.0
func (_c *MockHttp_Get_Call) Return(responseBody []byte, err error) *MockHttp_Get_Call
func (*MockHttp_Get_Call) Run ¶ added in v0.17.0
func (_c *MockHttp_Get_Call) Run(run func(url string)) *MockHttp_Get_Call
func (*MockHttp_Get_Call) RunAndReturn ¶ added in v0.17.0
func (_c *MockHttp_Get_Call) RunAndReturn(run func(url string) ([]byte, error)) *MockHttp_Get_Call
type MockHttp_Request_Call ¶ added in v0.17.0
MockHttp_Request_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Request'
func (*MockHttp_Request_Call) Return ¶ added in v0.17.0
func (_c *MockHttp_Request_Call) Return(responseBody []byte, err error) *MockHttp_Request_Call
func (*MockHttp_Request_Call) Run ¶ added in v0.17.0
func (_c *MockHttp_Request_Call) Run(run func(url string, method string, body io.Reader)) *MockHttp_Request_Call
func (*MockHttp_Request_Call) RunAndReturn ¶ added in v0.17.0
func (_c *MockHttp_Request_Call) RunAndReturn(run func(url string, method string, body io.Reader) ([]byte, error)) *MockHttp_Request_Call
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 ¶
func (_mock *MockPortal) DownloadBuildArtifact(product Product, build Build, file io.Writer, startByte int, quiet bool) error
DownloadBuildArtifact provides a mock function for the type MockPortal
func (*MockPortal) EXPECT ¶
func (_m *MockPortal) EXPECT() *MockPortal_Expecter
func (*MockPortal) GetApiKeyId ¶ added in v0.17.1
func (_mock *MockPortal) GetApiKeyId(oldKey string) (string, error)
GetApiKeyId provides a mock function for the type MockPortal
func (*MockPortal) ListAPIKeys ¶ added in v0.11.0
func (_mock *MockPortal) ListAPIKeys() ([]ApiKey, error)
ListAPIKeys provides a mock function for the type MockPortal
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) (*ApiKey, 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
func (*MockPortal) UpdateAPIKey ¶ added in v0.12.0
func (_mock *MockPortal) UpdateAPIKey(key string, expiresAt time.Time) error
UpdateAPIKey provides a mock function for the type MockPortal
func (*MockPortal) VerifyBuildArtifactDownload ¶ added in v0.18.0
func (_mock *MockPortal) VerifyBuildArtifactDownload(file io.Reader, download Build) error
VerifyBuildArtifactDownload 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, startByte int, quiet bool)) *MockPortal_DownloadBuildArtifact_Call
func (*MockPortal_DownloadBuildArtifact_Call) RunAndReturn ¶
func (_c *MockPortal_DownloadBuildArtifact_Call) RunAndReturn(run func(product Product, build Build, file io.Writer, startByte int, quiet bool) 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{}, startByte interface{}, quiet interface{}) *MockPortal_DownloadBuildArtifact_Call
DownloadBuildArtifact is a helper method to define mock.On call
- product Product
- build Build
- file io.Writer
- startByte int
- quiet bool
func (*MockPortal_Expecter) GetApiKeyId ¶ added in v0.17.1
func (_e *MockPortal_Expecter) GetApiKeyId(oldKey interface{}) *MockPortal_GetApiKeyId_Call
GetApiKeyId is a helper method to define mock.On call
- oldKey string
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 Product
- version string
- hash string
func (*MockPortal_Expecter) ListAPIKeys ¶ added in v0.11.0
func (_e *MockPortal_Expecter) ListAPIKeys() *MockPortal_ListAPIKeys_Call
ListAPIKeys is a helper method to define mock.On call
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 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 string
- organization string
- role string
- expiresAt time.Time
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 string
func (*MockPortal_Expecter) UpdateAPIKey ¶ added in v0.12.0
func (_e *MockPortal_Expecter) UpdateAPIKey(key interface{}, expiresAt interface{}) *MockPortal_UpdateAPIKey_Call
UpdateAPIKey is a helper method to define mock.On call
- key string
- expiresAt time.Time
func (*MockPortal_Expecter) VerifyBuildArtifactDownload ¶ added in v0.18.0
func (_e *MockPortal_Expecter) VerifyBuildArtifactDownload(file interface{}, download interface{}) *MockPortal_VerifyBuildArtifactDownload_Call
VerifyBuildArtifactDownload is a helper method to define mock.On call
- file io.Reader
- download Build
type MockPortal_GetApiKeyId_Call ¶ added in v0.17.1
MockPortal_GetApiKeyId_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetApiKeyId'
func (*MockPortal_GetApiKeyId_Call) Return ¶ added in v0.17.1
func (_c *MockPortal_GetApiKeyId_Call) Return(s string, err error) *MockPortal_GetApiKeyId_Call
func (*MockPortal_GetApiKeyId_Call) Run ¶ added in v0.17.1
func (_c *MockPortal_GetApiKeyId_Call) Run(run func(oldKey string)) *MockPortal_GetApiKeyId_Call
func (*MockPortal_GetApiKeyId_Call) RunAndReturn ¶ added in v0.17.1
func (_c *MockPortal_GetApiKeyId_Call) RunAndReturn(run func(oldKey string) (string, error)) *MockPortal_GetApiKeyId_Call
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_ListAPIKeys_Call ¶ added in v0.11.0
MockPortal_ListAPIKeys_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListAPIKeys'
func (*MockPortal_ListAPIKeys_Call) Return ¶ added in v0.11.0
func (_c *MockPortal_ListAPIKeys_Call) Return(apiKeys []ApiKey, err error) *MockPortal_ListAPIKeys_Call
func (*MockPortal_ListAPIKeys_Call) Run ¶ added in v0.11.0
func (_c *MockPortal_ListAPIKeys_Call) Run(run func()) *MockPortal_ListAPIKeys_Call
func (*MockPortal_ListAPIKeys_Call) RunAndReturn ¶ added in v0.11.0
func (_c *MockPortal_ListAPIKeys_Call) RunAndReturn(run func() ([]ApiKey, error)) *MockPortal_ListAPIKeys_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(apiKey *ApiKey, 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) (*ApiKey, 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 MockPortal_UpdateAPIKey_Call ¶ added in v0.12.0
MockPortal_UpdateAPIKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateAPIKey'
func (*MockPortal_UpdateAPIKey_Call) Return ¶ added in v0.12.0
func (_c *MockPortal_UpdateAPIKey_Call) Return(err error) *MockPortal_UpdateAPIKey_Call
func (*MockPortal_UpdateAPIKey_Call) Run ¶ added in v0.12.0
func (_c *MockPortal_UpdateAPIKey_Call) Run(run func(key string, expiresAt time.Time)) *MockPortal_UpdateAPIKey_Call
func (*MockPortal_UpdateAPIKey_Call) RunAndReturn ¶ added in v0.12.0
func (_c *MockPortal_UpdateAPIKey_Call) RunAndReturn(run func(key string, expiresAt time.Time) error) *MockPortal_UpdateAPIKey_Call
type MockPortal_VerifyBuildArtifactDownload_Call ¶ added in v0.18.0
MockPortal_VerifyBuildArtifactDownload_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'VerifyBuildArtifactDownload'
func (*MockPortal_VerifyBuildArtifactDownload_Call) Return ¶ added in v0.18.0
func (_c *MockPortal_VerifyBuildArtifactDownload_Call) Return(err error) *MockPortal_VerifyBuildArtifactDownload_Call
func (*MockPortal_VerifyBuildArtifactDownload_Call) Run ¶ added in v0.18.0
func (_c *MockPortal_VerifyBuildArtifactDownload_Call) Run(run func(file io.Reader, download Build)) *MockPortal_VerifyBuildArtifactDownload_Call
func (*MockPortal_VerifyBuildArtifactDownload_Call) RunAndReturn ¶ added in v0.18.0
func (_c *MockPortal_VerifyBuildArtifactDownload_Call) RunAndReturn(run func(file io.Reader, download Build) error) *MockPortal_VerifyBuildArtifactDownload_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, startByte int, quiet bool) error
VerifyBuildArtifactDownload(file io.Reader, download Build) error
RegisterAPIKey(owner string, organization string, role string, expiresAt time.Time) (*ApiKey, error)
RevokeAPIKey(key string) error
UpdateAPIKey(key string, expiresAt time.Time) error
ListAPIKeys() ([]ApiKey, error)
GetApiKeyId(oldKey string) (string, error)
}
type PortalClient ¶
type PortalClient struct {
Env env.Env
HttpClient HttpClient
}
func NewPortalClient ¶
func NewPortalClient() *PortalClient
func (*PortalClient) AuthorizedHttpRequest ¶ added in v0.16.0
AuthorizedHttpRequest sends a HTTP request with the necessary authorization headers.
func (*PortalClient) DownloadBuildArtifact ¶
func (c *PortalClient) DownloadBuildArtifact(product Product, build Build, file io.Writer, startByte int, quiet bool) error
DownloadBuildArtifact downloads the build artifact for the specified product and build.
func (*PortalClient) GetApiKeyId ¶ added in v0.17.1
func (c *PortalClient) GetApiKeyId(oldKey string) (string, error)
GetApiKeyId retrieves the key ID by sending the old key in the request header.
func (*PortalClient) GetBody ¶
func (c *PortalClient) GetBody(path string) (body []byte, status int, err error)
GetBody sends a GET request to the specified path and returns the response body and status code.
func (*PortalClient) GetBuild ¶
GetBuild retrieves a specific build for the given product, version, and hash.
func (*PortalClient) HttpRequest ¶
func (c *PortalClient) HttpRequest(method string, path string, body []byte) (resp *http.Response, err error)
HttpRequest sends an unauthorized HTTP request to the portal API with the specified method, path, and body.
func (*PortalClient) ListAPIKeys ¶ added in v0.11.0
func (c *PortalClient) ListAPIKeys() ([]ApiKey, error)
ListAPIKeys retrieves the list of API keys.
func (*PortalClient) ListBuilds ¶
func (c *PortalClient) ListBuilds(product Product) (availablePackages Builds, err error)
ListBuilds retrieves the list of available builds for the specified product.
func (*PortalClient) RegisterAPIKey ¶
func (c *PortalClient) RegisterAPIKey(owner string, organization string, role string, expiresAt time.Time) (*ApiKey, error)
RegisterAPIKey registers a new API key with the specified parameters.
func (*PortalClient) RevokeAPIKey ¶
func (c *PortalClient) RevokeAPIKey(keyId string) error
RevokeAPIKey revokes the API key with the specified key ID.
func (*PortalClient) UpdateAPIKey ¶ added in v0.12.0
func (c *PortalClient) UpdateAPIKey(key string, expiresAt time.Time) error
UpdateAPIKey updates the expiration date of the specified API key.
func (*PortalClient) VerifyBuildArtifactDownload ¶ added in v0.18.0
func (c *PortalClient) VerifyBuildArtifactDownload(file io.Reader, download Build) 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.