Documentation
¶
Overview ¶
* Copyright The Microcks Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright The Microcks Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientOptions ¶
type KeycloakClient ¶
type KeycloakClient interface {
ConnectAndGetToken() (string, error)
ConnectAndGetTokenAndRefreshToken(string, string) (string, string, error)
GetOIDCConfig() (*oauth2.Config, error)
}
KeycloakClient defines methods for cinteracting with Keycloak
func NewKeycloakClient ¶
func NewKeycloakClient(realmURL string, username string, password string) KeycloakClient
NewKeycloakClient build a new KeycloakClient implementation
type MicrocksClient ¶
type MicrocksClient interface {
HttpClient() *http.Client
GetKeycloakURL() (string, error)
SetOAuthToken(oauthToken string)
CreateTestResult(serviceID string, testEndpoint string, runnerType string, secretName string, timeout int64, filteredOperations string, operationsHeaders string, oAuth2Context string) (string, error)
GetTestResult(testResultID string) (*TestResultSummary, error)
UploadArtifact(specificationFilePath string, mainArtifact bool) (string, error)
DownloadArtifact(artifactURL string, mainArtifact bool, secret string) (string, error)
}
MicrocksClient allows interacting with Microcks APIs
func NewClient ¶
func NewClient(opts ClientOptions) (MicrocksClient, error)
func NewMicrocksClient ¶
func NewMicrocksClient(apiURL string) MicrocksClient
NewMicrocksClient builds a new headless MicrocksClient without any authtoken and all for general purposes
type OAuth2ClientContext ¶
type OAuth2ClientContext struct {
ClientId string `json:"clientId"`
ClientSecret string `json:"clientSecret"`
TokenURI string `json:"tokenUri"`
Username string `json:"username"`
Password string `json:"password"`
RefreshToken string `json:"refreshToken"`
GrantType string `json:"grantType"`
Scopes string `json:"scopes"`
}
OAuth2ClientContext represents a test request OAuth2 client context
type TestResultSummary ¶
type TestResultSummary struct {
ID string `json:"id"`
Version int32 `json:"version"`
TestNumber int32 `json:"testNumber"`
TestDate int64 `json:"testDate"`
TestedEndpoint string `json:"testedEndpoint"`
ServiceID string `json:"serviceId"`
ElapsedTime int32 `json:"elapsedTime"`
Success bool `json:"success"`
InProgress bool `json:"inProgress"`
}
TestResultSummary represents a simple view on Microcks TestResult