cortex

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UserAgentPrefix is the prefix of the User-Agent header that all terraform REST calls perform.
	UserAgentPrefix = "cortex-terraform-provider"
)

Variables

View Source
var (
	ApiErrorNotFound     = errors.New("not found")
	ApiErrorUnauthorized = errors.New("unauthorized")
)
View Source
var BaseUris = map[string]string{
	"teams":                "/api/v1/teams/",
	"departments":          "/api/v1/teams/departments/",
	"scorecards":           "/api/v1/scorecards/",
	"catalog_entities":     "/api/v1/catalog/",
	"open_api":             "/api/v1/open-api",
	"resource_definitions": "/api/v1/catalog/definitions/",
}

Functions

func AnyToFloat64 added in v0.1.10

func AnyToFloat64(unk any) (float64, error)

func InterfaceToString added in v0.1.7

func InterfaceToString(v interface{}) (string, error)

func MapFetch

func MapFetch(m map[string]interface{}, key string, defaultValue any) any

func MapFetchToString

func MapFetchToString(m map[string]interface{}, key string) string

func Route

func Route(domain string, path string) string

func StringToInterface added in v0.1.7

func StringToInterface(v string) (interface{}, error)

func WithContext

func WithContext(ctx context.Context) func(*HttpClient) error

WithContext Specify the context for the cortex client to use.

func WithToken

func WithToken(token string) func(*HttpClient) error

WithToken Specify the API token for the cortex client to use.

func WithURL

func WithURL(baseUrl string) func(*HttpClient) error

WithURL Specify the base URL for the cortex client to connect to.

func WithVersion

func WithVersion(version string) func(*HttpClient) error

Types

type ApiError

type ApiError struct {
	Details           string `json:"details"`
	GatewayHttpStatus int    `json:"gatewayHttpStatus"`
	HttpStatus        int    `json:"httpStatus"`
	Message           string `json:"message"`
	RequestId         string `json:"requestId"`
	Type              string `json:"type"`
}

func (ApiError) String

func (err ApiError) String() string

type ArchiveTeamResponse

type ArchiveTeamResponse struct{}

type CatalogEntitiesClient

type CatalogEntitiesClient struct {
	// contains filtered or unexported fields
}

func (*CatalogEntitiesClient) Client

func (c *CatalogEntitiesClient) Client() *sling.Sling

func (*CatalogEntitiesClient) Delete

func (c *CatalogEntitiesClient) Delete(ctx context.Context, tag string) error

func (*CatalogEntitiesClient) Get

func (*CatalogEntitiesClient) GetFromDescriptor

func (c *CatalogEntitiesClient) GetFromDescriptor(ctx context.Context, tag string) (CatalogEntityData, error)

func (*CatalogEntitiesClient) List

List retrieves a list of scorecards based on a query.

func (*CatalogEntitiesClient) Upsert

func (*CatalogEntitiesClient) YamlClient added in v0.1.3

func (c *CatalogEntitiesClient) YamlClient() *sling.Sling

type CatalogEntitiesClientInterface

type CatalogEntitiesClientInterface interface {
	Get(ctx context.Context, tag string) (*CatalogEntity, error)
	GetFromDescriptor(ctx context.Context, tag string) (CatalogEntityData, error)
	List(ctx context.Context, params *CatalogEntityListParams) (*CatalogEntitiesResponse, error)
	Upsert(ctx context.Context, req UpsertCatalogEntityRequest) (CatalogEntityData, error)
	Delete(ctx context.Context, tag string) error
}

type CatalogEntitiesResponse

type CatalogEntitiesResponse struct {
	Entities []CatalogEntity `json:"entities" yaml:"entities"`
}

CatalogEntitiesResponse is the response from the GET /v1/scorecards endpoint.

type CatalogEntity

type CatalogEntity struct {
	Tag          string                 `json:"tag" yaml:"x-cortex-tag"`
	Title        string                 `json:"title" yaml:"title"`
	Description  string                 `json:"description" yaml:"description"`
	Type         string                 `json:"type" yaml:"x-cortex-type"`
	Groups       []string               `json:"groups" yaml:"x-cortex-groups"`
	Links        []CatalogEntityLink    `json:"links" yaml:"x-cortex-link"`
	Metadata     map[string]interface{} `json:"metadata" yaml:"x-cortex-custom-metadata"`
	Dependencies []string               `json:"dependencies" yaml:"x-cortex-dependency"`
	Ownership    CatalogEntityOwnership `json:"ownership" yaml:"x-cortex-owners"`
}

CatalogEntity is the nested response object that is typically returned from the catalog entities endpoints.

type CatalogEntityAlert

type CatalogEntityAlert struct {
	Type  string `json:"type" yaml:"type"`
	Tag   string `json:"tag" yaml:"tag"`
	Value string `json:"value" yaml:"value"`
}

func (*CatalogEntityAlert) Enabled added in v0.0.3

func (o *CatalogEntityAlert) Enabled() bool

type CatalogEntityApm

type CatalogEntityApm struct {
	DataDog   CatalogEntityApmDataDog    `json:"datadog,omitempty" yaml:"datadog,omitempty"`
	Dynatrace CatalogEntityApmDynatrace  `json:"dynatrace,omitempty" yaml:"dynatrace,omitempty"`
	NewRelic  []CatalogEntityApmNewRelic `json:"newrelic,omitempty" yaml:"newrelic,omitempty"`
}

func (*CatalogEntityApm) Enabled added in v0.0.2

func (c *CatalogEntityApm) Enabled() bool

type CatalogEntityApmDataDog

type CatalogEntityApmDataDog struct {
	Monitors []int64 `json:"monitors" yaml:"monitors"`
}

func (*CatalogEntityApmDataDog) Enabled added in v0.0.2

func (o *CatalogEntityApmDataDog) Enabled() bool

type CatalogEntityApmDynatrace

type CatalogEntityApmDynatrace struct {
	EntityIDs          []string `json:"entityIds,omitempty" yaml:"entityIds,omitempty"`
	EntityNameMatchers []string `json:"entityNameMatchers,omitempty" yaml:"entityNameMatchers,omitempty"`
}

func (*CatalogEntityApmDynatrace) Enabled added in v0.0.2

func (o *CatalogEntityApmDynatrace) Enabled() bool

type CatalogEntityApmNewRelic

type CatalogEntityApmNewRelic struct {
	ApplicationID int64  `json:"applicationId" yaml:"applicationId"`
	Alias         string `json:"alias,omitempty" yaml:"alias,omitempty"`
}

func (*CatalogEntityApmNewRelic) Enabled added in v0.0.2

func (o *CatalogEntityApmNewRelic) Enabled() bool

type CatalogEntityBugSnag

type CatalogEntityBugSnag struct {
	Project string `json:"project" yaml:"project"`
}

func (*CatalogEntityBugSnag) Enabled added in v0.0.2

func (o *CatalogEntityBugSnag) Enabled() bool

type CatalogEntityCheckmarx

type CatalogEntityCheckmarx struct {
	Projects []CatalogEntityCheckmarxProject `json:"projects" yaml:"projects"`
}

func (*CatalogEntityCheckmarx) Enabled added in v0.0.2

func (o *CatalogEntityCheckmarx) Enabled() bool

type CatalogEntityCheckmarxProject

type CatalogEntityCheckmarxProject struct {
	ID   int64  `json:"projectId,omitempty" yaml:"projectId,omitempty"`
	Name string `json:"projectName,omitempty" yaml:"projectName,omitempty"`
}

type CatalogEntityChild added in v0.1.0

type CatalogEntityChild struct {
	Tag string `json:"tag" yaml:"tag"`
}

type CatalogEntityCiCd added in v0.1.8

type CatalogEntityCiCd struct {
	Buildkite CatalogEntityCiCdBuildkite `json:"buildkite,omitempty" yaml:"buildkite,omitempty"`
}

func (*CatalogEntityCiCd) Enabled added in v0.1.8

func (c *CatalogEntityCiCd) Enabled() bool

type CatalogEntityCiCdBuildkite added in v0.1.8

type CatalogEntityCiCdBuildkite struct {
	Pipelines []CatalogEntityCiCdBuildkitePipeline `json:"pipelines" yaml:"pipelines"`
	Tags      []CatalogEntityCiCdBuildkiteTag      `json:"tags,omitempty" yaml:"tags,omitempty"`
}

func (*CatalogEntityCiCdBuildkite) Enabled added in v0.1.8

func (o *CatalogEntityCiCdBuildkite) Enabled() bool

type CatalogEntityCiCdBuildkitePipeline added in v0.1.8

type CatalogEntityCiCdBuildkitePipeline struct {
	Slug string `json:"slug" yaml:"slug"`
}

func (*CatalogEntityCiCdBuildkitePipeline) Enabled added in v0.1.8

type CatalogEntityCiCdBuildkiteTag added in v0.1.8

type CatalogEntityCiCdBuildkiteTag struct {
	Tag string `json:"tag" yaml:"tag"`
}

func (*CatalogEntityCiCdBuildkiteTag) Enabled added in v0.1.8

func (o *CatalogEntityCiCdBuildkiteTag) Enabled() bool

type CatalogEntityCoralogix added in v0.2.1

type CatalogEntityCoralogix struct {
	Applications []CatalogEntityCoralogixApplication `json:"applications" yaml:"applications"`
}

func (*CatalogEntityCoralogix) Enabled added in v0.2.1

func (o *CatalogEntityCoralogix) Enabled() bool

type CatalogEntityCoralogixApplication added in v0.2.1

type CatalogEntityCoralogixApplication struct {
	Name  string `json:"applicationName,omitempty" yaml:"applicationName"`
	Alias string `json:"alias,omitempty" yaml:"alias,omitempty"`
}

func (*CatalogEntityCoralogixApplication) Enabled added in v0.2.1

type CatalogEntityCustomData

type CatalogEntityCustomData struct {
	Tag         string      `json:"tag"` // tag of catalog entity
	Key         string      `json:"key"` // key of custom data
	Description string      `json:"description,omitempty"`
	Source      string      `json:"source"`
	Value       interface{} `json:"value"`
	DateUpdated string      `json:"dateUpdated,omitempty"`
}

func (*CatalogEntityCustomData) ID

func (*CatalogEntityCustomData) ToUpsertRequest added in v0.1.7

ToUpsertRequest https://docs.cortex.io/docs/api/add-custom-data-for-entity

func (*CatalogEntityCustomData) ValueAsString added in v0.1.7

func (c *CatalogEntityCustomData) ValueAsString() (string, error)

type CatalogEntityCustomDataClient

type CatalogEntityCustomDataClient struct {
	// contains filtered or unexported fields
}

func (*CatalogEntityCustomDataClient) Client

func (*CatalogEntityCustomDataClient) Delete added in v0.1.7

func (c *CatalogEntityCustomDataClient) Delete(ctx context.Context, entityTag string, key string) error

func (*CatalogEntityCustomDataClient) Get

func (*CatalogEntityCustomDataClient) List

List retrieves a list of scorecards based on a query.

func (*CatalogEntityCustomDataClient) Upsert added in v0.1.7

type CatalogEntityCustomDataClientInterface

type CatalogEntityCustomDataClientInterface interface {
	Get(ctx context.Context, entityTag string, key string) (CatalogEntityCustomData, error)
	List(ctx context.Context, entityTag string, params CatalogEntityCustomDataListParams) ([]CatalogEntityCustomData, error)
	Upsert(ctx context.Context, entityTag string, req UpsertCatalogEntityCustomDataRequest) (CatalogEntityCustomData, error)
	Delete(ctx context.Context, entityTag string, key string) error
}

type CatalogEntityCustomDataListParams

type CatalogEntityCustomDataListParams struct{}

CatalogEntityCustomDataListParams are the query parameters for the GET /v1/catalog/:tag/custom-data endpoint.

type CatalogEntityDashboards

type CatalogEntityDashboards struct {
	Embeds []CatalogEntityDashboardsEmbed `json:"embeds,omitempty" yaml:"embeds,omitempty"`
}

func (*CatalogEntityDashboards) Enabled added in v0.0.2

func (c *CatalogEntityDashboards) Enabled() bool

type CatalogEntityDashboardsEmbed

type CatalogEntityDashboardsEmbed struct {
	Type string `json:"type" yaml:"type"` // <datadog | grafana | newrelic>
	URL  string `json:"url" yaml:"url"`
}

type CatalogEntityData

type CatalogEntityData struct {
	Title          string                      `json:"title" yaml:"title"`
	Description    string                      `json:"description,omitempty" yaml:"description,omitempty"`
	Tag            string                      `json:"x-cortex-tag" yaml:"x-cortex-tag"`
	Type           string                      `json:"x-cortex-type,omitempty" yaml:"x-cortex-type,omitempty"`
	Definition     map[string]interface{}      `json:"x-cortex-definition,omitempty" yaml:"x-cortex-definition,omitempty"`
	Owners         []CatalogEntityOwner        `json:"x-cortex-owners,omitempty" yaml:"x-cortex-owners,omitempty"`
	Children       []CatalogEntityChild        `json:"x-cortex-children,omitempty" yaml:"x-cortex-children,omitempty"`
	DomainParents  []CatalogEntityDomainParent `json:"x-cortex-domain-parents,omitempty" yaml:"x-cortex-domain-parents,omitempty"`
	Groups         []string                    `json:"x-cortex-groups,omitempty" yaml:"x-cortex-groups,omitempty"` // TODO: is this -groups or -service-groups? docs unclear
	Links          []CatalogEntityLink         `json:"x-cortex-link,omitempty" yaml:"x-cortex-link,omitempty"`
	IgnoreMetadata bool                        `json:"-" yaml:"-"`
	Metadata       map[string]interface{}      `json:"x-cortex-custom-metadata,omitempty" yaml:"x-cortex-custom-metadata,omitempty"`
	Dependencies   []CatalogEntityDependency   `json:"x-cortex-dependency,omitempty" yaml:"x-cortex-dependency,omitempty"`

	// Various generic integration attributes
	Alerts         []CatalogEntityAlert        `json:"x-cortex-alerts,omitempty" yaml:"x-cortex-alerts,omitempty"`
	Apm            CatalogEntityApm            `json:"x-cortex-apm,omitempty" yaml:"x-cortex-apm,omitempty"`
	Dashboards     CatalogEntityDashboards     `json:"x-cortex-dashboards,omitempty" yaml:"x-cortex-dashboards,omitempty"`
	Git            CatalogEntityGit            `json:"x-cortex-git,omitempty" yaml:"x-cortex-git,omitempty"`
	Issues         CatalogEntityIssues         `json:"x-cortex-issues,omitempty" yaml:"x-cortex-issues,omitempty"`
	OnCall         CatalogEntityOnCall         `json:"x-cortex-oncall,omitempty" yaml:"x-cortex-oncall,omitempty"`
	SLOs           CatalogEntitySLOs           `json:"x-cortex-slos,omitempty" yaml:"x-cortex-slos,omitempty"`
	StaticAnalysis CatalogEntityStaticAnalysis `json:"x-cortex-static-analysis,omitempty" yaml:"x-cortex-static-analysis,omitempty"`
	CiCd           CatalogEntityCiCd           `json:"x-cortex-ci-cd,omitempty" yaml:"x-cortex-ci-cd,omitempty"`

	// Integration-specific things
	BugSnag        CatalogEntityBugSnag         `json:"x-cortex-bugsnag,omitempty" yaml:"x-cortex-bugsnag,omitempty"`
	Checkmarx      CatalogEntityCheckmarx       `json:"x-cortex-checkmarx,omitempty" yaml:"x-cortex-checkmarx,omitempty"`
	Coralogix      CatalogEntityCoralogix       `json:"x-cortex-coralogix,omitempty" yaml:"x-cortex-coralogix,omitempty"`
	FireHydrant    CatalogEntityFireHydrant     `json:"x-cortex-firehydrant,omitempty" yaml:"x-cortex-firehydrant,omitempty"`
	MicrosoftTeams []CatalogEntityMicrosoftTeam `json:"x-cortex-microsoft-teams,omitempty" yaml:"x-cortex-microsoft-teams,omitempty"`
	Rollbar        CatalogEntityRollbar         `json:"x-cortex-rollbar,omitempty" yaml:"x-cortex-rollbar,omitempty"`
	Sentry         CatalogEntitySentry          `json:"x-cortex-sentry,omitempty" yaml:"x-cortex-sentry,omitempty"`
	ServiceNow     CatalogEntityServiceNow      `json:"x-cortex-servicenow,omitempty" yaml:"x-cortex-servicenow,omitempty"`
	Slack          CatalogEntitySlack           `json:"x-cortex-slack,omitempty" yaml:"x-cortex-slack,omitempty"`
	Snyk           CatalogEntitySnyk            `json:"x-cortex-snyk,omitempty" yaml:"x-cortex-snyk,omitempty"`
	Wiz            CatalogEntityWiz             `json:"x-cortex-wiz,omitempty" yaml:"x-cortex-wiz,omitempty"`

	// Infrastructure, Resources, and Deployments attributes
	K8s CatalogEntityK8s `json:"x-cortex-k8s,omitempty" yaml:"x-cortex-k8s,omitempty"`

	// Team-specific attributes
	Team CatalogEntityTeam `json:"team" yaml:"x-cortex-team,omitempty"`
}

CatalogEntityData is a struct used from YAML-based data, since its structure does not match the structure of the CatalogEntity struct in other responses. See: https://github.com/cortexapps/solutions/blob/master/examples/yaml/catalog/resource.yaml

type CatalogEntityDependency

type CatalogEntityDependency struct {
	Tag         string                 `json:"tag" yaml:"tag"`
	Method      string                 `json:"method,omitempty" yaml:"method,omitempty"`
	Path        string                 `json:"path,omitempty" yaml:"path,omitempty"`
	Description string                 `json:"description,omitempty" yaml:"description,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty"`
}

type CatalogEntityDomainParent added in v0.1.7

type CatalogEntityDomainParent struct {
	Tag string `json:"tag" yaml:"tag"`
}

type CatalogEntityEmail

type CatalogEntityEmail struct {
	Email       string `json:"email" yaml:"email"`
	Description string `json:"description" yaml:"description"`
}

type CatalogEntityFireHydrant added in v0.1.0

type CatalogEntityFireHydrant struct {
	Services []CatalogEntityFireHydrantService `json:"services" yaml:"services"`
}

func (*CatalogEntityFireHydrant) Enabled added in v0.1.0

func (o *CatalogEntityFireHydrant) Enabled() bool

type CatalogEntityFireHydrantService added in v0.1.0

type CatalogEntityFireHydrantService struct {
	ID   string `json:"identifier" yaml:"identifier"`
	Type string `json:"identifierType" yaml:"identifierType"`
}

func (*CatalogEntityFireHydrantService) Enabled added in v0.1.0

type CatalogEntityGetDescriptorParams

type CatalogEntityGetDescriptorParams struct {
	Yaml bool `url:"yaml"`
}

type CatalogEntityGit

type CatalogEntityGit struct {
	Github    CatalogEntityGitGithub      `json:"github,omitempty" yaml:"github,omitempty"`
	Gitlab    CatalogEntityGitGitlab      `json:"gitlab,omitempty" yaml:"gitlab,omitempty"`
	Azure     CatalogEntityGitAzureDevOps `json:"azure,omitempty" yaml:"azure,omitempty"`
	BitBucket CatalogEntityGitBitBucket   `json:"bitbucket,omitempty" yaml:"bitbucket,omitempty"`
}

CatalogEntityGit represents the Git metadata around a catalog entity @see https://docs.cortex.io/docs/reference/basics/entities#example-cortexyaml-for-service-entity

func (*CatalogEntityGit) Enabled added in v0.0.2

func (o *CatalogEntityGit) Enabled() bool

type CatalogEntityGitAzureDevOps

type CatalogEntityGitAzureDevOps struct {
	Project    string `json:"project" yaml:"project"`
	Repository string `json:"repository" yaml:"repository"`
	BasePath   string `json:"basepath,omitempty" yaml:"basepath,omitempty"`
}

func (*CatalogEntityGitAzureDevOps) Enabled added in v0.0.2

func (o *CatalogEntityGitAzureDevOps) Enabled() bool

type CatalogEntityGitBitBucket

type CatalogEntityGitBitBucket struct {
	Repository string `json:"repository" yaml:"repository"`
}

func (*CatalogEntityGitBitBucket) Enabled added in v0.0.2

func (o *CatalogEntityGitBitBucket) Enabled() bool

type CatalogEntityGitGithub

type CatalogEntityGitGithub struct {
	Repository string `json:"repository" yaml:"repository"`
	BasePath   string `json:"basepath,omitempty" yaml:"basepath,omitempty"`
}

func (*CatalogEntityGitGithub) Enabled added in v0.0.2

func (o *CatalogEntityGitGithub) Enabled() bool

type CatalogEntityGitGitlab

type CatalogEntityGitGitlab struct {
	Repository string `json:"repository" yaml:"repository"`
	BasePath   string `json:"basepath,omitempty" yaml:"basepath,omitempty"`
}

func (*CatalogEntityGitGitlab) Enabled added in v0.0.2

func (o *CatalogEntityGitGitlab) Enabled() bool

type CatalogEntityGroup

type CatalogEntityGroup struct {
	GroupName   string `json:"group" yaml:"groupName"`
	Description string `json:"description" yaml:"description"`
	Provider    string `json:"provider" yaml:"provider"`
}

type CatalogEntityGroupMember added in v0.1.7

type CatalogEntityGroupMember struct {
	Name     string `json:"name" yaml:"name"`
	Provider string `json:"provider" yaml:"provider"`
}

func (*CatalogEntityGroupMember) Enabled added in v0.1.7

func (o *CatalogEntityGroupMember) Enabled() bool

type CatalogEntityIssues

type CatalogEntityIssues struct {
	Jira CatalogEntityIssuesJira `json:"jira,omitempty" yaml:"jira,omitempty"`
}

func (*CatalogEntityIssues) Enabled added in v0.0.2

func (c *CatalogEntityIssues) Enabled() bool

type CatalogEntityIssuesJira

type CatalogEntityIssuesJira struct {
	DefaultJQL string   `json:"defaultJql,omitempty" yaml:"defaultJql,omitempty"`
	Projects   []string `json:"projects,omitempty" yaml:"projects,omitempty"`
	Labels     []string `json:"labels,omitempty" yaml:"labels,omitempty"`
	Components []string `json:"components,omitempty" yaml:"components,omitempty"`
}

func (*CatalogEntityIssuesJira) Enabled added in v0.0.2

func (o *CatalogEntityIssuesJira) Enabled() bool

type CatalogEntityK8s added in v0.2.1

type CatalogEntityK8s struct {
	Deployments  []CatalogEntityK8sDeployment  `json:"deployment,omitempty" yaml:"deployment,omitempty"`
	ArgoRollouts []CatalogEntityK8sArgoRollout `json:"argorollout,omitempty" yaml:"argorollout,omitempty"`
	StatefulSets []CatalogEntityK8sStatefulSet `json:"statefulset,omitempty" yaml:"statefulset,omitempty"`
	CronJobs     []CatalogEntityK8sCronJob     `json:"cronjob,omitempty" yaml:"cronjob,omitempty"`
}

func (*CatalogEntityK8s) Enabled added in v0.2.1

func (o *CatalogEntityK8s) Enabled() bool

type CatalogEntityK8sArgoRollout added in v0.2.1

type CatalogEntityK8sArgoRollout struct {
	Identifier string `json:"identifier" yaml:"identifier"`
	Cluster    string `json:"cluster,omitempty" yaml:"cluster,omitempty"`
}

func (*CatalogEntityK8sArgoRollout) Enabled added in v0.2.1

func (o *CatalogEntityK8sArgoRollout) Enabled() bool

type CatalogEntityK8sCronJob added in v0.2.1

type CatalogEntityK8sCronJob struct {
	Identifier string `json:"identifier" yaml:"identifier"`
	Cluster    string `json:"cluster,omitempty" yaml:"cluster,omitempty"`
}

func (*CatalogEntityK8sCronJob) Enabled added in v0.2.1

func (o *CatalogEntityK8sCronJob) Enabled() bool

type CatalogEntityK8sDeployment added in v0.2.1

type CatalogEntityK8sDeployment struct {
	Identifier string `json:"identifier" yaml:"identifier"`
	Cluster    string `json:"cluster,omitempty" yaml:"cluster,omitempty"`
}

func (*CatalogEntityK8sDeployment) Enabled added in v0.2.1

func (o *CatalogEntityK8sDeployment) Enabled() bool

type CatalogEntityK8sStatefulSet added in v0.2.1

type CatalogEntityK8sStatefulSet struct {
	Identifier string `json:"identifier" yaml:"identifier"`
	Cluster    string `json:"cluster,omitempty" yaml:"cluster,omitempty"`
}

func (*CatalogEntityK8sStatefulSet) Enabled added in v0.2.1

func (o *CatalogEntityK8sStatefulSet) Enabled() bool
type CatalogEntityLink struct {
	Name string `json:"name" yaml:"name"`
	Type string `json:"type" yaml:"type"` // runbook, documentation, logs, dashboard, metrics, healthcheck
	Url  string `json:"url" yaml:"url"`
}

type CatalogEntityListParams

type CatalogEntityListParams struct {
	Groups          []string `url:"groups,omitempty"`
	Types           []string `url:"types,omitempty"`
	GitRepositories []string `url:"gitRepositories,omitempty"`
}

CatalogEntityListParams are the query parameters for the GET /v1/catalog endpoint.

type CatalogEntityMicrosoftTeam added in v0.2.0

type CatalogEntityMicrosoftTeam struct {
	Name                 string `json:"name" yaml:"name"`
	Description          string `json:"description,omitempty" yaml:"description,omitempty"`
	NotificationsEnabled bool   `json:"notificationsEnabled,omitempty" yaml:"notificationsEnabled,omitempty"`
}

func (*CatalogEntityMicrosoftTeam) Enabled added in v0.2.0

func (o *CatalogEntityMicrosoftTeam) Enabled() bool

type CatalogEntityOnCall

type CatalogEntityOnCall struct {
	PagerDuty CatalogEntityOnCallPagerDuty `json:"pagerduty,omitempty" yaml:"pagerduty,omitempty"`
	OpsGenie  CatalogEntityOnCallOpsGenie  `json:"opsgenie,omitempty" yaml:"opsgenie,omitempty"`
	VictorOps CatalogEntityOnCallVictorOps `json:"victorops,omitempty" yaml:"victorops,omitempty"`
	XMatters  CatalogEntityOnCallXMatters  `json:"xmatters,omitempty" yaml:"xmatters,omitempty"`
}

func (*CatalogEntityOnCall) Enabled added in v0.0.2

func (c *CatalogEntityOnCall) Enabled() bool

type CatalogEntityOnCallOpsGenie

type CatalogEntityOnCallOpsGenie struct {
	ID   string `json:"id" yaml:"id"`
	Type string `json:"type" yaml:"type"`
}

func (*CatalogEntityOnCallOpsGenie) Enabled added in v0.0.2

func (o *CatalogEntityOnCallOpsGenie) Enabled() bool

type CatalogEntityOnCallPagerDuty

type CatalogEntityOnCallPagerDuty struct {
	ID   string `json:"id" yaml:"id"`
	Type string `json:"type" yaml:"type"`
}

func (*CatalogEntityOnCallPagerDuty) Enabled added in v0.0.2

func (o *CatalogEntityOnCallPagerDuty) Enabled() bool

type CatalogEntityOnCallVictorOps

type CatalogEntityOnCallVictorOps struct {
	ID   string `json:"id" yaml:"id"`
	Type string `json:"type" yaml:"type"`
}

func (*CatalogEntityOnCallVictorOps) Enabled added in v0.0.2

func (o *CatalogEntityOnCallVictorOps) Enabled() bool

type CatalogEntityOnCallXMatters added in v0.1.0

type CatalogEntityOnCallXMatters struct {
	ID   string `json:"id" yaml:"id"`
	Type string `json:"type" yaml:"type"`
}

func (*CatalogEntityOnCallXMatters) Enabled added in v0.1.0

func (o *CatalogEntityOnCallXMatters) Enabled() bool

type CatalogEntityOwner

type CatalogEntityOwner struct {
	Type                 string `json:"type" yaml:"type"`                       // group, user, slack
	Name                 string `json:"name,omitempty" yaml:"name,omitempty"`   // Must be of form <org>/<team>
	Email                string `json:"email,omitempty" yaml:"email,omitempty"` // user only
	Description          string `json:"description,omitempty" yaml:"description,omitempty"`
	Provider             string `json:"provider,omitempty" yaml:"provider,omitempty"`
	Channel              string `json:"channel,omitempty" yaml:"channel,omitempty"` // for slack, do not add # to beginning
	NotificationsEnabled bool   `json:"notificationsEnabled,omitempty" yaml:"notificationsEnabled,omitempty"`
}

type CatalogEntityOwnership

type CatalogEntityOwnership struct {
	Emails        []CatalogEntityEmail                 `json:"emails"`
	Groups        []CatalogEntityGroup                 `json:"groups"`
	SlackChannels []CatalogEntityOwnershipSlackChannel `json:"slackChannels"`
}

type CatalogEntityOwnershipSlackChannel added in v0.1.8

type CatalogEntityOwnershipSlackChannel struct {
	Channel              string `json:"channel" yaml:"channel"`
	Description          string `json:"description" yaml:"description"`
	NotificationsEnabled bool   `json:"notificationsEnabled" yaml:"notificationsEnabled"`
}

type CatalogEntityParser

type CatalogEntityParser struct{}

func (*CatalogEntityParser) YamlToEntity

func (c *CatalogEntityParser) YamlToEntity(yamlEntity map[string]interface{}) (CatalogEntityData, error)

YamlToEntity converts YAML into a CatalogEntity, from the specification.

type CatalogEntityRollbar

type CatalogEntityRollbar struct {
	Project string `json:"project" yaml:"project"`
}

func (*CatalogEntityRollbar) Enabled added in v0.0.2

func (o *CatalogEntityRollbar) Enabled() bool

type CatalogEntitySLODataDog

type CatalogEntitySLODataDog struct {
	ID string `json:"id" yaml:"id"`
}

func (*CatalogEntitySLODataDog) Enabled added in v0.0.2

func (o *CatalogEntitySLODataDog) Enabled() bool

type CatalogEntitySLODynatrace

type CatalogEntitySLODynatrace struct {
	ID string `json:"id" yaml:"id"`
}

func (*CatalogEntitySLODynatrace) Enabled added in v0.0.2

func (o *CatalogEntitySLODynatrace) Enabled() bool

type CatalogEntitySLOLightstepStream

type CatalogEntitySLOLightstepStream struct {
	StreamID string                           `json:"streamId" yaml:"streamId"`
	Targets  CatalogEntitySLOLightstepTargets `json:"targets" yaml:"targets"`
}

type CatalogEntitySLOLightstepTargetLatency

type CatalogEntitySLOLightstepTargetLatency struct {
	Percentile float64 `json:"percentile" yaml:"percentile"`
	Target     int64   `json:"target" yaml:"target"`
	SLO        float64 `json:"slo" yaml:"slo"`
}

type CatalogEntitySLOLightstepTargets

type CatalogEntitySLOLightstepTargets struct {
	Latencies []CatalogEntitySLOLightstepTargetLatency `json:"latency" yaml:"latency"`
}

type CatalogEntitySLOPrometheusQuery

type CatalogEntitySLOPrometheusQuery struct {
	ErrorQuery string  `json:"errorQuery" yaml:"errorQuery"`
	TotalQuery string  `json:"totalQuery" yaml:"totalQuery"`
	SLO        float64 `json:"slo" yaml:"slo"`
	Name       string  `json:"name,omitempty" yaml:"name,omitempty"`
	Alias      string  `json:"alias,omitempty" yaml:"alias,omitempty"`
}

type CatalogEntitySLOSignalFX

type CatalogEntitySLOSignalFX struct {
	Query     string `json:"query" yaml:"query"`
	Rollup    string `json:"rollup" yaml:"rollup"`
	Target    int64  `json:"target" yaml:"target"`
	Lookback  string `json:"lookback" yaml:"lookback"`
	Operation string `json:"operation" yaml:"operation"`
}

type CatalogEntitySLOSumoLogic

type CatalogEntitySLOSumoLogic struct {
	ID string `json:"id" yaml:"id"`
}

func (*CatalogEntitySLOSumoLogic) Enabled added in v0.0.2

func (o *CatalogEntitySLOSumoLogic) Enabled() bool

type CatalogEntitySLOs

type CatalogEntitySLOs struct {
	DataDog    []CatalogEntitySLODataDog         `json:"datadog,omitempty" yaml:"datadog,omitempty"`
	Dynatrace  []CatalogEntitySLODynatrace       `json:"dynatrace,omitempty" yaml:"dynatrace,omitempty"`
	Lightstep  []CatalogEntitySLOLightstepStream `json:"lightstep,omitempty" yaml:"lightstep,omitempty"`
	Prometheus []CatalogEntitySLOPrometheusQuery `json:"prometheus,omitempty" yaml:"prometheus,omitempty"`
	SignalFX   []CatalogEntitySLOSignalFX        `json:"signalfx,omitempty" yaml:"signalfx,omitempty"`
	SumoLogic  []CatalogEntitySLOSumoLogic       `json:"sumologic,omitempty" yaml:"sumologic,omitempty"`
}

func (*CatalogEntitySLOs) Enabled added in v0.0.2

func (c *CatalogEntitySLOs) Enabled() bool

type CatalogEntitySentry

type CatalogEntitySentry struct {
	Project string `json:"project" yaml:"project"`
}

func (*CatalogEntitySentry) Enabled added in v0.0.2

func (o *CatalogEntitySentry) Enabled() bool

type CatalogEntityServiceNow added in v0.2.0

type CatalogEntityServiceNow struct {
	Services []CatalogEntityServiceNowService `json:"services" yaml:"services"`
}

func (*CatalogEntityServiceNow) Enabled added in v0.2.0

func (o *CatalogEntityServiceNow) Enabled() bool

type CatalogEntityServiceNowService added in v0.2.0

type CatalogEntityServiceNowService struct {
	ID        int64  `json:"id" yaml:"id"`
	TableName string `json:"tableName" yaml:"tableName"`
}

func (*CatalogEntityServiceNowService) Enabled added in v0.2.0

func (o *CatalogEntityServiceNowService) Enabled() bool

type CatalogEntitySlack added in v0.1.8

type CatalogEntitySlack struct {
	Channels []CatalogEntitySlackChannel `json:"channels,omitempty" yaml:"channels,omitempty"`
}

func (*CatalogEntitySlack) Enabled added in v0.1.8

func (o *CatalogEntitySlack) Enabled() bool

type CatalogEntitySlackChannel

type CatalogEntitySlackChannel struct {
	Name                 string `json:"name" yaml:"name"`
	NotificationsEnabled bool   `json:"notificationsEnabled,omitempty" yaml:"notificationsEnabled,omitempty"`
}

func (*CatalogEntitySlackChannel) Enabled added in v0.1.8

func (o *CatalogEntitySlackChannel) Enabled() bool

type CatalogEntitySnyk

type CatalogEntitySnyk struct {
	Projects []CatalogEntitySnykProject `json:"projects,omitempty" yaml:"projects,omitempty"`
}

func (*CatalogEntitySnyk) Enabled added in v0.0.2

func (o *CatalogEntitySnyk) Enabled() bool

type CatalogEntitySnykProject

type CatalogEntitySnykProject struct {
	Organization string `json:"organizationId" yaml:"organizationId"`
	ProjectID    string `json:"projectId" yaml:"projectId"`
	Source       string `json:"source,omitempty" yaml:"source,omitempty"`
}

type CatalogEntityStaticAnalysis

type CatalogEntityStaticAnalysis struct {
	CodeCov   CatalogEntityStaticAnalysisCodeCov   `json:"codecov,omitempty" yaml:"codecov,omitempty"`
	Mend      CatalogEntityStaticAnalysisMend      `json:"mend,omitempty" yaml:"mend,omitempty"`
	SonarQube CatalogEntityStaticAnalysisSonarQube `json:"sonarqube,omitempty" yaml:"sonarqube,omitempty"`
	Veracode  CatalogEntityStaticAnalysisVeracode  `json:"veracode,omitempty" yaml:"veracode,omitempty"`
}

func (*CatalogEntityStaticAnalysis) Enabled added in v0.0.2

func (c *CatalogEntityStaticAnalysis) Enabled() bool

type CatalogEntityStaticAnalysisCodeCov

type CatalogEntityStaticAnalysisCodeCov struct {
	Repository string `json:"repo" yaml:"repo"`
	Provider   string `json:"provider" yaml:"provider"`
	Owner      string `json:"owner" yaml:"owner"`
	Flag       string `json:"flag" yaml:"flag"`
}

func (*CatalogEntityStaticAnalysisCodeCov) Enabled added in v0.0.2

type CatalogEntityStaticAnalysisMend

type CatalogEntityStaticAnalysisMend struct {
	ApplicationIDs []string `json:"applicationIds,omitempty" yaml:"applicationIds,omitempty"`
	ProjectIDs     []string `json:"projectIds,omitempty" yaml:"projectIds,omitempty"`
}

func (*CatalogEntityStaticAnalysisMend) Enabled added in v0.0.2

type CatalogEntityStaticAnalysisSonarQube

type CatalogEntityStaticAnalysisSonarQube struct {
	Project string `json:"project" yaml:"project"`
	Alias   string `json:"alias,omitempty" yaml:"alias,omitempty"`
}

func (*CatalogEntityStaticAnalysisSonarQube) Enabled added in v0.0.2

type CatalogEntityStaticAnalysisVeracode

type CatalogEntityStaticAnalysisVeracode struct {
	ApplicationNames []string                                     `json:"applicationNames,omitempty" yaml:"applicationNames,omitempty"`
	Sandboxes        []CatalogEntityStaticAnalysisVeracodeSandbox `json:"sandboxes,omitempty" yaml:"sandboxes,omitempty"`
}

func (*CatalogEntityStaticAnalysisVeracode) Enabled added in v0.0.2

type CatalogEntityStaticAnalysisVeracodeSandbox

type CatalogEntityStaticAnalysisVeracodeSandbox struct {
	ApplicationName string `json:"applicationName,omitempty" yaml:"applicationName,omitempty"`
	SandboxName     string `json:"sandboxName,omitempty" yaml:"sandboxName,omitempty"`
}

type CatalogEntityTeam added in v0.1.7

type CatalogEntityTeam struct {
	Members []CatalogEntityTeamMember  `json:"members" yaml:"members,omitempty"`
	Groups  []CatalogEntityGroupMember `json:"groups" yaml:"groups,omitempty"`
}

func (*CatalogEntityTeam) Enabled added in v0.1.7

func (o *CatalogEntityTeam) Enabled() bool

type CatalogEntityTeamMember added in v0.1.7

type CatalogEntityTeamMember struct {
	Name                 string `json:"name" yaml:"name"`
	Email                string `json:"email" yaml:"email"`
	Role                 string `json:"role,omitempty" yaml:"role,omitempty"`
	NotificationsEnabled bool   `json:"notificationsEnabled" yaml:"notificationsEnabled"`
}

func (*CatalogEntityTeamMember) Enabled added in v0.1.7

func (o *CatalogEntityTeamMember) Enabled() bool

type CatalogEntityViolation

type CatalogEntityViolation struct {
	Description   string   `json:"description"`
	ViolationType string   `json:"violationType"`
	StartLine     int      `json:"startLine"`
	EndLine       int      `json:"endLine"`
	Paths         []string `json:"paths"`
	Pointer       string   `json:"pointer"`
	RuleLink      string   `json:"ruleLink"`
	Title         string   `json:"title"`
}

func (*CatalogEntityViolation) String

func (v *CatalogEntityViolation) String() string

type CatalogEntityWiz added in v0.1.0

type CatalogEntityWiz struct {
	Projects []CatalogEntityWizProject `json:"projects,omitempty" yaml:"projects,omitempty"`
}

func (*CatalogEntityWiz) Enabled added in v0.1.0

func (o *CatalogEntityWiz) Enabled() bool

type CatalogEntityWizProject added in v0.1.0

type CatalogEntityWizProject struct {
	ProjectID string `json:"projectId" yaml:"projectId"`
}

type CreateDepartmentRequest

type CreateDepartmentRequest struct {
	Tag         string             `json:"departmentTag" url:"departmentTag"`
	Name        string             `json:"name"`
	Description string             `json:"description,omitempty"`
	Members     []DepartmentMember `json:"members"`
}

type CreateResourceDefinitionRequest

type CreateResourceDefinitionRequest struct {
	Type        string                 `json:"type"`
	Name        string                 `json:"name,omitempty"`
	Description string                 `json:"description,omitempty"`
	Schema      map[string]interface{} `json:"schema,omitempty"`
	Source      string                 `json:"source,omitempty"`
}

type CreateResourceDefinitionResponse

type CreateResourceDefinitionResponse struct {
	ResourceDefinition *ResourceDefinition `json:"scorecard"`
}

type CreateTeamRequest

type CreateTeamRequest struct {
	TeamTag           string             `json:"teamTag"`
	Type              string             `json:"type"`
	Metadata          TeamMetadata       `json:"metadata"`
	IsArchived        bool               `json:"isArchived,omitempty"`
	AdditionalMembers []TeamMember       `json:"additionalMembers"`
	SlackChannels     []TeamSlackChannel `json:"slackChannels"`
	Links             []TeamLink         `json:"links"`
	CortexTeam        TeamCortexManaged  `json:"cortexTeam,omitempty"`
	IdpGroup          TeamIdpGroup       `json:"idpGroup,omitempty"`
}

type DeleteCatalogEntityCustomDataRequest added in v0.1.7

type DeleteCatalogEntityCustomDataRequest struct {
	Key   string `json:"key" url:"key"`
	Force bool   `json:"force" url:"force,omitempty"`
}

type DeleteCatalogEntityCustomDataResponse added in v0.1.7

type DeleteCatalogEntityCustomDataResponse struct{}

type DeleteCatalogEntityResponse

type DeleteCatalogEntityResponse struct{}

type DeleteDepartmentRequest

type DeleteDepartmentRequest struct {
	DepartmentTag string `json:"departmentTag" url:"departmentTag"`
}

type DeleteDepartmentResponse

type DeleteDepartmentResponse struct{}

type DeleteResourceDefinitionResponse

type DeleteResourceDefinitionResponse struct{}

type DeleteScorecardResponse

type DeleteScorecardResponse struct{}

type DeleteTeamRequest

type DeleteTeamRequest struct {
	Tag string `json:"teamTag" url:"teamTag"`
}

type DeleteTeamResponse

type DeleteTeamResponse struct{}

type Department

type Department struct {
	Tag         string             `json:"departmentTag" url:"departmentTag"`
	Name        string             `json:"name"`
	Description string             `json:"description,omitempty"`
	Members     []DepartmentMember `json:"members"`
}

Department is the response from the GET /v1/teams/departments/ endpoint.

func (*Department) ToCreateRequest added in v0.1.7

func (r *Department) ToCreateRequest() CreateDepartmentRequest

ToCreateRequest https://docs.cortex.io/docs/api/create-department

func (*Department) ToUpdateRequest added in v0.1.7

func (r *Department) ToUpdateRequest() UpdateDepartmentRequest

ToUpdateRequest https://docs.cortex.io/docs/api/update-department

type DepartmentGetParams

type DepartmentGetParams struct {
	DepartmentTag string `json:"departmentTag" url:"departmentTag"`
}

type DepartmentMember

type DepartmentMember struct {
	Description string `json:"description,omitempty"`
	Name        string `json:"name"`
	Email       string `json:"email"`
}

type DepartmentsClient

type DepartmentsClient struct {
	// contains filtered or unexported fields
}

func (*DepartmentsClient) Client

func (c *DepartmentsClient) Client() *sling.Sling

func (*DepartmentsClient) Create

func (*DepartmentsClient) Delete

func (c *DepartmentsClient) Delete(ctx context.Context, tag string) error

func (*DepartmentsClient) Get

func (*DepartmentsClient) Update

type DepartmentsClientInterface

type DepartmentsClientInterface interface {
	Get(ctx context.Context, tag string) (Department, error)
	Create(ctx context.Context, req CreateDepartmentRequest) (Department, error)
	Update(ctx context.Context, tag string, req UpdateDepartmentRequest) (Department, error)
	Delete(ctx context.Context, tag string) error
}

type DepartmentsResponse

type DepartmentsResponse struct {
	Departments []Department `json:"department"`
}

type GetScorecardResponse

type GetScorecardResponse struct {
	Scorecard Scorecard `json:"scorecard"`
}

GetScorecardResponse is the generic root response object for scorecards.

type HttpClient

type HttpClient struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(opts ...OptionDelegator) (*HttpClient, error)

NewClient initializes a new API client for Cortex.

func (*HttpClient) CatalogEntities

func (c *HttpClient) CatalogEntities() CatalogEntitiesClientInterface

func (*HttpClient) CatalogEntityCustomData

func (c *HttpClient) CatalogEntityCustomData() CatalogEntityCustomDataClientInterface

func (*HttpClient) Client added in v0.1.3

func (c *HttpClient) Client() *sling.Sling

func (*HttpClient) Departments

func (c *HttpClient) Departments() DepartmentsClientInterface

func (*HttpClient) Ping

func (c *HttpClient) Ping(ctx context.Context) error

func (*HttpClient) ResourceDefinitions

func (c *HttpClient) ResourceDefinitions() ResourceDefinitionsClientInterface

func (*HttpClient) Scorecards

func (c *HttpClient) Scorecards() ScorecardsClientInterface

func (*HttpClient) Teams

func (c *HttpClient) Teams() TeamsClientInterface

func (*HttpClient) YamlClient added in v0.1.3

func (c *HttpClient) YamlClient() *sling.Sling

type OptionDelegator

type OptionDelegator func(c *HttpClient) error

type ResourceDefinition

type ResourceDefinition struct {
	Type        string                 `json:"type" yaml:"type"`
	Name        string                 `json:"name,omitempty" yaml:"name,omitempty"`
	Description string                 `json:"description,omitempty" yaml:"description,omitempty"`
	Schema      map[string]interface{} `json:"schema,omitempty" yaml:"schema,omitempty"`
	Source      string                 `json:"source,omitempty" yaml:"source,omitempty"`
}

ResourceDefinition is the response object that is typically returned from the resource definitions endpoints.

func (*ResourceDefinition) SchemaAsString added in v0.1.7

func (r *ResourceDefinition) SchemaAsString() (string, error)

func (*ResourceDefinition) ToCreateRequest added in v0.1.7

func (*ResourceDefinition) ToUpdateRequest added in v0.1.7

type ResourceDefinitionListParams

type ResourceDefinitionListParams struct {
	IncludeBuiltIn bool `url:"includeBuiltIn,omitempty"`
}

ResourceDefinitionListParams are the query parameters for the GET /v1/catalog/definitions endpoint.

type ResourceDefinitionsClient

type ResourceDefinitionsClient struct {
	// contains filtered or unexported fields
}

func (*ResourceDefinitionsClient) Client

func (c *ResourceDefinitionsClient) Client() *sling.Sling

func (*ResourceDefinitionsClient) Create

func (*ResourceDefinitionsClient) Delete

func (c *ResourceDefinitionsClient) Delete(ctx context.Context, typeName string) error

func (*ResourceDefinitionsClient) Get

func (*ResourceDefinitionsClient) List

List retrieves a list of resource definitions based on a query.

func (*ResourceDefinitionsClient) Update

type ResourceDefinitionsResponse

type ResourceDefinitionsResponse struct {
	ResourceDefinitions []ResourceDefinition `json:"definitions"`
}

ResourceDefinitionsResponse is the response from the GET /v1/catalog/definitions endpoint.

type Scorecard

type Scorecard struct {
	Tag         string              `json:"tag" yaml:"tag"`
	Name        string              `json:"name" yaml:"name"`
	Description string              `json:"description,omitempty" yaml:"description,omitempty"`
	Draft       bool                `json:"draft,omitempty" yaml:"draft,omitempty"`
	Rules       []ScorecardRule     `json:"rules,omitempty" yaml:"rules,omitempty"`
	Ladder      ScorecardLadder     `json:"ladder,omitempty" yaml:"ladder,omitempty"`
	Filter      ScorecardFilter     `json:"filter,omitempty" yaml:"filter,omitempty"`
	Evaluation  ScorecardEvaluation `json:"evaluation,omitempty" yaml:"evaluation,omitempty"`
}

Scorecard is the nested response object that is typically returned from the scorecards endpoints.

func (*Scorecard) ToYaml added in v0.1.7

func (s *Scorecard) ToYaml() (string, error)

func (*Scorecard) ToYamlStringReader added in v0.1.7

func (s *Scorecard) ToYamlStringReader() (*strings.Reader, error)

type ScorecardEvaluation

type ScorecardEvaluation struct {
	Window int64 `json:"window,omitempty" yaml:"window,omitempty"`
}

func (*ScorecardEvaluation) Enabled added in v0.1.7

func (s *ScorecardEvaluation) Enabled() bool

type ScorecardFilter

type ScorecardFilter struct {
	Category string `json:"category,omitempty" yaml:"category,omitempty"`
	Query    string `json:"query,omitempty" yaml:"query,omitempty"`
}

func (*ScorecardFilter) Enabled added in v0.1.7

func (s *ScorecardFilter) Enabled() bool

type ScorecardLadder

type ScorecardLadder struct {
	Levels []ScorecardLevel `json:"levels" yaml:"levels"`
}

func (*ScorecardLadder) Enabled added in v0.1.7

func (s *ScorecardLadder) Enabled() bool

type ScorecardLevel

type ScorecardLevel struct {
	Name        string `json:"name" yaml:"name"`
	Rank        int64  `json:"rank" yaml:"rank"`
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	Color       string `json:"color" yaml:"color"`
}

func (*ScorecardLevel) Enabled added in v0.1.7

func (s *ScorecardLevel) Enabled() bool

type ScorecardParser added in v0.1.7

type ScorecardParser struct{}

func (*ScorecardParser) YamlToEntity added in v0.1.7

func (c *ScorecardParser) YamlToEntity(yamlEntity map[string]interface{}) (Scorecard, error)

YamlToEntity converts YAML into a Scorecard, from the specification.

type ScorecardRule

type ScorecardRule struct {
	Title          string `json:"title" yaml:"title"`
	Expression     string `json:"expression" yaml:"expression"`
	Weight         int64  `json:"weight" yaml:"weight"`
	Level          string `json:"level" yaml:"level"`
	Description    string `json:"description,omitempty" yaml:"description,omitempty"`
	FailureMessage string `json:"failure_message,omitempty" yaml:"failureMessage,omitempty"`
}

type ScorecardsClient

type ScorecardsClient struct {
	// contains filtered or unexported fields
}

func (*ScorecardsClient) Client

func (c *ScorecardsClient) Client() *sling.Sling

func (*ScorecardsClient) Delete

func (c *ScorecardsClient) Delete(ctx context.Context, tag string) error

func (*ScorecardsClient) Get

func (c *ScorecardsClient) Get(ctx context.Context, tag string) (Scorecard, error)

func (*ScorecardsClient) Upsert

func (c *ScorecardsClient) Upsert(ctx context.Context, scorecard Scorecard) (Scorecard, error)

func (*ScorecardsClient) YamlClient added in v0.1.7

func (c *ScorecardsClient) YamlClient() *sling.Sling

type ScorecardsClientInterface

type ScorecardsClientInterface interface {
	Get(ctx context.Context, tag string) (Scorecard, error)
	Upsert(ctx context.Context, scorecard Scorecard) (Scorecard, error)
	Delete(ctx context.Context, tag string) error
}

type Team

type Team struct {
	AdditionalMembers []TeamMember       `json:"additionalMembers,omitempty"`
	IsArchived        bool               `json:"isArchived,omitempty"`
	Metadata          TeamMetadata       `json:"metadata"`
	SlackChannels     []TeamSlackChannel `json:"slackChannels,omitempty"`
	Links             []TeamLink         `json:"links,omitempty"`
	TeamTag           string             `json:"teamTag"`
}

Team is the response from the GET /v1/teams/{team_tag} endpoint.

type TeamCortexManaged

type TeamCortexManaged struct {
	Members []TeamMember `json:"members"`
}

type TeamIdpGroup

type TeamIdpGroup struct {
	Group    string               `json:"group"`
	Members  []TeamIdpGroupMember `json:"members"`
	Provider string               `json:"provider"`
}

type TeamIdpGroupMember

type TeamIdpGroupMember struct {
	Email string `json:"email,omitempty"`
	ID    string `json:"id"`
	Name  string `json:"name"`
}
type TeamLink struct {
	Name        string `json:"name"`
	Type        string `json:"type,omitempty"`
	Url         string `json:"url"`
	Description string `json:"description,omitempty"`
}

type TeamListParams

type TeamListParams struct {
}

TeamListParams are the query parameters for the GET /v1/teams endpoint.

type TeamMember

type TeamMember struct {
	Description string `json:"description,omitempty"`
	Name        string `json:"name"`
	Email       string `json:"email"`
}

type TeamMetadata

type TeamMetadata struct {
	Description string `json:"description,omitempty"`
	Name        string `json:"name"`
	Summary     string `json:"summary,omitempty"`
}

type TeamSlackChannel

type TeamSlackChannel struct {
	Name                 string `json:"name"`
	NotificationsEnabled bool   `json:"notificationsEnabled"`
}

type TeamsClient

type TeamsClient struct {
	// contains filtered or unexported fields
}

func (*TeamsClient) Archive

func (c *TeamsClient) Archive(ctx context.Context, tag string) error

func (*TeamsClient) Client

func (c *TeamsClient) Client() *sling.Sling

func (*TeamsClient) Create

func (c *TeamsClient) Create(ctx context.Context, req CreateTeamRequest) (*Team, error)

func (*TeamsClient) Delete

func (c *TeamsClient) Delete(ctx context.Context, tag string) error

func (*TeamsClient) Get

func (c *TeamsClient) Get(ctx context.Context, tag string) (*Team, error)

func (*TeamsClient) List

func (c *TeamsClient) List(ctx context.Context, params *TeamListParams) (*TeamsResponse, error)

List retrieves a list of teams based on a team query.

func (*TeamsClient) Unarchive

func (c *TeamsClient) Unarchive(ctx context.Context, tag string) error

func (*TeamsClient) Update

func (c *TeamsClient) Update(ctx context.Context, tag string, req UpdateTeamRequest) (*Team, error)

type TeamsClientInterface

type TeamsClientInterface interface {
	Get(ctx context.Context, tag string) (*Team, error)
	List(ctx context.Context, params *TeamListParams) (*TeamsResponse, error)
	Create(ctx context.Context, createReq CreateTeamRequest) (*Team, error)
	Update(ctx context.Context, tag string, updateReq UpdateTeamRequest) (*Team, error)
	Delete(ctx context.Context, tag string) error
	Archive(ctx context.Context, tag string) error
	Unarchive(ctx context.Context, tag string) error
}

type TeamsResponse

type TeamsResponse struct {
	Teams []Team `json:"teams"`
}

TeamsResponse is the response from the GET /v1/teams endpoint.

type UnarchiveTeamResponse

type UnarchiveTeamResponse struct{}

type UpdateDepartmentRequest

type UpdateDepartmentRequest struct {
	Name        string             `json:"name"`
	Description string             `json:"description,omitempty"`
	Members     []DepartmentMember `json:"members"`
}

type UpdateResourceDefinitionRequest

type UpdateResourceDefinitionRequest struct {
	Name        string                 `json:"name,omitempty"`
	Description string                 `json:"description,omitempty"`
	Schema      map[string]interface{} `json:"schema,omitempty"`
}

type UpdateTeamRequest

type UpdateTeamRequest struct {
	Metadata          TeamMetadata       `json:"metadata"`
	Links             []TeamLink         `json:"links"`
	SlackChannels     []TeamSlackChannel `json:"slackChannels"`
	AdditionalMembers []TeamMember       `json:"additionalMembers"`
}

type UpsertCatalogEntityCustomDataRequest added in v0.1.7

type UpsertCatalogEntityCustomDataRequest struct {
	Key         string      `json:"key"`
	Description string      `json:"description,omitempty"`
	Value       interface{} `json:"value"`
	Force       bool        `json:"force" url:"force,omitempty"`
}

type UpsertCatalogEntityRequest

type UpsertCatalogEntityRequest struct {
	Info    CatalogEntityData `json:"info"`
	OpenApi string            `json:"openapi"`
}

type UpsertCatalogEntityResponse

type UpsertCatalogEntityResponse struct {
	Ok         bool                     `json:"ok"`
	Violations []CatalogEntityViolation `json:"violations"`
}

type UpsertScorecardResponse

type UpsertScorecardResponse struct {
	Scorecard Scorecard `json:"scorecard" yaml:"scorecard"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL