Discover Packages
github.com/bluengop/cortex-client
pkg
client
v1
package
Version:
v0.0.0-...-4f679da
Opens a new window with list of versions in this module.
Published: Mar 28, 2024
License: GPL-3.0
Opens a new window with license information.
Imports: 11
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
type Children struct {
Children *Children `json:"children"`
Definition Definition `json:"definition"`
Description string `json:"description"`
Groups []string `json:"groups"`
Name string `json:"name"`
Tag string `json:"tag"`
Type string `json:"type"`
}
Cortex API Client
NewClient() returns a new HTTP Client for Cortex
it requires a valid API Key (Bearer token).
Send HTTP Request Method
given a context and a request pointers, sends
the http request and returns a response object
type Definition struct {
Definition any `json:"definition"`
}
type Email struct {
Description string `json:"description"`
Email string `json:"email"`
Inheritance string `json:"inheritance"`
}
type ErrorResponse struct {
Details string `json:"details"`
GatewayHTTPStatus int32 `json:"gatewayHttpStatus"`
HTTPStatus int32 `json:"httpStatus"`
Message string `json:"message"`
RequestID string `json:"requestId"`
Type string `json:"type"`
}
type Git struct {
Alias string `json:"alias"`
Basepath string `json:"basepath"`
Provider string `json:"provider"`
Repository string `json:"repository"`
RepositoryURL string `json:"repositoryUrl"`
}
type Group struct {
Description string `json:"description"`
GroupName string `json:"groupName"`
Inheritance string `json:"inheritance"`
Provider string `json:"provider"`
}
type Hierarchy struct {
Children []Children `json:"children"`
Parents []Parents `json:"parents"`
}
type Individual struct {
Description string `json:"description"`
Email string `json:"email"`
}
type Link struct {
Name string `json:"name"`
Type string `json:"type"`
Url string `json:"url"`
}
type Metadata struct {
Key string `json:"key"`
Value string `json:"value"`
}
type OwnersV2 struct {
Individuals []Individual `json:"individuals"`
Teams []Team `json:"teams"`
}
type Ownership struct {
Emails []Email `json:"emails"`
Groups []Group `json:"groups"`
}
type Parameters struct {
Tag string `json:"tag,omitempty"`
}
HTTP Request parameters
So far I've only added the entity tag (x-cortex-tag)
that identifies the entity.
type Parents struct {
Definition Definition `json:"definition"`
Description string `json:"description"`
Groups []string `json:"groups"`
Name string `json:"name"`
Parents *Parents `json:"parents"`
Tag string `json:"tag"`
Type string `json:"type"`
}
Request struct
Returns new Request instance
The parameters accepted by the function are:
1. A pointer to a context.
2. The HTTP method (case insensitive).
3. The Base URL for the API call.
4. The path inside the above Base URL (resource route).
5. (Optionally) custom headers for the request.
type Response struct {
Success bool `json:"ok"`
ErrorResponse ErrorResponse `json:"error,omitempty"`
SuccessResponse SuccessResponse `json:"success,omitempty"`
}
type SlackChannel struct {
Description string `json:"description"`
Name string `json:"name"`
NotificationsEnabled bool `json:"notificationsEnabled"`
}
type SuccessResponse struct {
Definition Definition `json:"definition"`
Description string `json:"description"`
Git Git `json:"git"`
Groups []string `json:"groups"`
Hierarchy Hierarchy `json:"hierarchy"`
IsArchived bool `json:"isArchived"`
LastUpdated string `json:"lastUpdated"`
Links []Link `json:"links"`
Metadata []Metadata `json:"metadata"`
Name string `json:"name"`
OwnersV2 OwnersV2 `json:"ownersV2"`
Ownership Ownership `json:"ownership"`
SlackChannels []SlackChannel `json:"slackChannels"`
Tag string `json:"tag"`
Type string `json:"type"`
}
type Team struct {
Description string `json:"description"`
IsArchived bool `json:"isArchived"`
Name string `json:"name"`
Tag string `json:"tag"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.