{"modulePath":"github.com/smartcontractkit/chainlink-testing-framework/libs","version":"v0.0.0-20240227141906-ec710b4eb1a3","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package client\n\n## Constants\n\n```go\nconst (\n\tQueryMemoryUsage          = `100 * (1 - ((avg_over_time(node_memory_MemFree_bytes[%s]) + avg_over_time(node_memory_Cached_bytes[%s]) + avg_over_time(node_memory_Buffers_bytes[%s])) / avg_over_time(node_memory_MemTotal_bytes[%s])))`\n\tQueryAllCPUBusyPercentage = `100 - (avg by (instance) (irate(node_cpu_seconds_total{mode=\"idle\"}[%s])) * 100)`\n)\n```\nQuery constants\n\n## Types\n\n```go\ntype AdapterResponse struct {\n\tId    string        `json:\"id\"`\n\tData  AdapterResult `json:\"data\"`\n\tError interface{}   `json:\"error\"`\n}\n```\nAdapterResponse represents a response from an adapter\n\n```go\ntype AdapterResult struct {\n\tResult interface{} `json:\"result\"`\n}\n```\nAdapterResult represents an int result for an adapter\n\n```go\ntype ContractInfoJSON struct {\n\tContractAddress string `json:\"contractAddress\"`\n\tContractVersion int    `json:\"contractVersion\"`\n\tPath            string `json:\"path\"`\n\tStatus          string `json:\"status\"`\n}\n```\nContractInfoJSON represents an element of the contracts array used to deliver configs to otpe\n\n```go\ntype ExplorerClient struct {\n\tAPIClient *resty.Client\n\tConfig    *ExplorerConfig\n}\n```\nExplorerClient is used to call Explorer API endpoints\n\n```go\nfunc NewExplorerClient(cfg *ExplorerConfig) *ExplorerClient\n```\nNewExplorerClient creates a new explorer mock client\n\n```go\nfunc (em *ExplorerClient) PostAdminNodes(nodeName string) (NodeAccessKeys, error)\n```\nPostAdminNodes is used to exercise the POST /api/v1/admin/nodes endpoint This endpoint is used to create access keys for nodes\n\n```go\ntype ExplorerConfig struct {\n\tURL           string\n\tAdminUsername string\n\tAdminPassword string\n}\n```\nExplorerConfig holds config information for ExplorerClient\n\n```go\ntype GithubClient struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewGithubClient(token string) *GithubClient\n```\n\n```go\nfunc (g *GithubClient) ListLatestCLCoreReleases(count int) ([]*github.RepositoryRelease, error)\n```\n\n```go\nfunc (g *GithubClient) ListLatestCLCoreTags(count int) ([]*github.RepositoryTag, error)\n```\n\n```go\ntype HttpInitializer struct {\n\tId       string       `json:\"id\"`\n\tRequest  HttpRequest  `json:\"httpRequest\"`\n\tResponse HttpResponse `json:\"httpResponse\"`\n}\n```\nHttpInitializer represents an element of the initializer array used in the mockserver initializer\n\n```go\ntype HttpInitializerTemplate struct {\n\tId       string               `json:\"id\"`\n\tRequest  HttpRequest          `json:\"httpRequest\"`\n\tResponse HttpResponseTemplate `json:\"httpResponseTemplate\"`\n}\n```\nHttpInitializer represents an element of the initializer array used in the mockserver initializer\n\n```go\ntype HttpRequest struct {\n\tPath string `json:\"path\"`\n}\n```\nHttpRequest represents the httpRequest json object used in the mockserver initializer\n\n```go\ntype HttpResponse struct {\n\tBody interface{} `json:\"body\"`\n}\n```\nHttpResponse represents the httpResponse json object used in the mockserver initializer\n\n```go\ntype HttpResponseTemplate struct {\n\tTemplate     string `json:\"template\"`\n\tTemplateType string `json:\"templateType\"`\n}\n```\nHttpResponse represents the httpResponse json object used in the mockserver initializer\n\n```go\ntype KafkaRestClient struct {\n\tAPIClient *resty.Client\n\tConfig    *KafkaRestConfig\n}\n```\nKafkaRestClient kafka-rest client\n\n```go\nfunc NewKafkaRestClient(cfg *KafkaRestConfig) *KafkaRestClient\n```\nNewKafkaRestClient creates a new KafkaRestClient\n\n```go\nfunc (krc *KafkaRestClient) GetTopics() ([]string, error)\n```\nGetTopics Get a list of Kafka topics.\n\n```go\ntype KafkaRestConfig struct {\n\tURL string\n}\n```\nKafkaRestConfig holds config information for KafkaRestClient\n\n```go\ntype MockserverClient struct {\n\tAPIClient *resty.Client\n\tConfig    *MockserverConfig\n}\n```\nMockserverClient mockserver client\n\n```go\nfunc ConnectMockServer(e *environment.Environment) (*MockserverClient, error)\n```\nConnectMockServer creates a connection to a deployed mockserver in the environment\n\n```go\nfunc ConnectMockServerURL(url string) (*MockserverClient, error)\n```\nConnectMockServerURL creates a connection to a mockserver at a given url, should only be used for inside K8s tests\n\n```go\nfunc NewMockserverClient(cfg *MockserverConfig) *MockserverClient\n```\nNewMockserverClient returns a mockserver client\n\n```go\nfunc (em *MockserverClient) ClearExpectation(body interface{}) error\n```\nClearExpectation clears expectations\n\n```go\nfunc (em *MockserverClient) LocalURL() string\n```\nLocalURL returns the local url of the mockserver\n\n```go\nfunc (em *MockserverClient) PutExpectations(body interface{}) error\n```\nPutExpectations sets the expectations (i.e. mocked responses)\n\n```go\nfunc (em *MockserverClient) SetAnyValuePath(path string, v interface{}) error\n```\nSetAnyValuePath sets any type of value for a path\n\n```go\nfunc (em *MockserverClient) SetAnyValueResponse(path string, v interface{}) error\n```\n\n```go\nfunc (em *MockserverClient) SetRandomValuePath(path string) error\n```\nSetRandomValuePath sets a random int value for a path\n\n```go\nfunc (em *MockserverClient) SetStringValuePath(path string, stringValue string) error\n```\nSetStringValuePath sets a string value for a path and returns it as a raw string\n\n```go\nfunc (em *MockserverClient) SetValuePath(path string, v int) error\n```\nSetValuePath sets an int for a path\n\n```go\ntype MockserverConfig struct {\n\tLocalURL   string\n\tClusterURL string\n}\n```\nMockserverConfig holds config information for MockserverClient\n\n```go\ntype Name struct {\n\tName string `json:\"name\"`\n}\n```\nName is the body of the request\n\n```go\ntype NodeAccessKeys struct {\n\tID        string `json:\"id\"`\n\tAccessKey string `json:\"accessKey\"`\n\tSecret    string `json:\"secret\"`\n}\n```\nNodeAccessKeys is the body of the response\n\n```go\ntype NodeInfoJSON struct {\n\tID          string   `json:\"id\"`\n\tNodeAddress []string `json:\"nodeAddress\"`\n}\n```\nNodeInfoJSON represents an element of the nodes array used to deliver configs to otpe\n\n```go\ntype PathSelector struct {\n\tPath string `json:\"path\"`\n}\n```\nPathSelector represents the json object used to find expectations by path\n\n```go\ntype PostgresConfig struct {\n\tHost     string\n\tPort     string\n\tUser     string\n\tPassword string\n\tDBName   string\n\tSSLMode  string\n}\n```\nPostgresConfig postgres config for connection string\n\n```go\ntype PostgresConnector struct {\n\t*sqlx.DB\n\tCfg *PostgresConfig\n}\n```\nPostgresConnector sqlx postgres connector\n\n```go\nfunc ConnectDB(nodeNum int, e *environment.Environment) (*PostgresConnector, error)\n```\n\n```go\nfunc NewPostgresConnector(cfg *PostgresConfig) (*PostgresConnector, error)\n```\nNewPostgresConnector creates new sqlx postgres connector\n\n```go\ntype Prometheus struct {\n\tv1.API\n}\n```\nPrometheus ease of use for v1.API\n\n```go\nfunc NewPrometheusClient(url string) (*Prometheus, error)\n```\nNewPrometheusClient returns a prometheus client\n\n```go\nfunc (p *Prometheus) CPUBusyPercentage() (float64, error)\n```\nCPUBusyPercentage host CPU busy percentage\n\n```go\nfunc (p *Prometheus) GetAlerts() (v1.AlertsResult, error)\n```\nGetAlerts returns all firing alerts\n\n```go\nfunc (p *Prometheus) GetQuery(query string) (model.Value, error)\n```\nGetQuery returns the result of applying a PromQL query\n\n```go\nfunc (p *Prometheus) MemoryUsage() (float64, error)\n```\nMemoryUsage total memory used by interval\n\n```go\nfunc (p *Prometheus) ResourcesSummary() (float64, float64, error)\n```\nResourcesSummary returns a summary of memory and cpu used\n\n```go\ntype ResourcesSummary struct {\n\tMemoryUsage   float64\n\tCPUPercentage float64\n}\n```\nResourcesSummary Data for memory and cpu usage\n\n","path":"github.com/smartcontractkit/chainlink-testing-framework/libs/client","name":"client","synopsis":"","isRedistributable":true}
