Documentation ¶
Index ¶
- Constants
- func CheckReservedKey(k Key) error
- func IsReservedKey(k Key) bool
- type CreatedBy
- type Key
- type ScheduledModelType
- type SingletonTags
- type Source
- type Tags
- func (t Tags) Add(key tags.Key, value string)
- func (t Tags) AsSingletonTags() SingletonTags
- func (t Tags) Clone() Tags
- func (t Tags) Intersect(t2 Tags)
- func (t Tags) Set(key tags.Key, values []string)
- func (t Tags) SetAll(t2 Tags)
- func (t Tags) SetSingleton(key tags.Key, value string)
- func (t Tags) Union(t2 Tags)
- type Value
- type ValueSet
- func (vs ValueSet) Add(v Value)
- func (vs ValueSet) AsSlice() []Value
- func (vs ValueSet) Clone() ValueSet
- func (vs ValueSet) GetFirst() (v Value, exists bool)
- func (vs ValueSet) Intersect(other ValueSet)
- func (vs ValueSet) MarshalJSON() ([]byte, error)
- func (vs ValueSet) Union(other ValueSet)
- func (vs *ValueSet) UnmarshalJSON(b []byte) error
Constants ¶
const ( XAkitaOriginalOrganizationID = "x-akita-original-organization-id" XAkitaOriginalService = "x-akita-original-service" XAkitaOriginalServiceID = "x-akita-original-service-id" XAkitaOriginalSpec = "x-akita-original-spec" XAkitaOriginalSpecID = "x-akita-original-spec-id" )
Tags applied to a copy of the spec
Variables ¶
This section is empty.
Functions ¶
func CheckReservedKey ¶
Returns an error if the key is reserved for Postman internal use.
func IsReservedKey ¶
Determines whether a key is reserved for Postman internal use.
Types ¶
type Key ¶
const ( // Identifies the source of a trace or spec. See `Source` for values. XAkitaSource Key = "x-akita-source" // Identifies the process by which a trace or spec was created. See // `CreatedBy` for values. XAkitaCreatedBy Key = "x-akita-created-by" // The original filesystem path of an uploaded trace. XAkitaTraceLocalPath Key = "x-akita-trace-local-path" // The type of scheduled model, if XAkitaCreatedBy == CreatedBySchedule. XAkitaScheduledModelType Key = "x-akita-scheduled-model-type" // The version of the service(s) under observation, as defined by the // user. XAkitaServiceVersion Key = "x-akita-service-version" )
const ( // Identifies the CI framework from which a trace or spec was obtained (e.g., // CircleCI, Travis). XAkitaCI Key = "x-akita-ci" // Each model derived from a PR (or MR) is automatically diffed against a // baseline spec. This tag identifies the AKID for that baseline spec. // Attached to specs. XAkitaComparedWith Key = "x-akita-compared-with" // Each model derived from a PR (or MR) is automatically diffed against a // baseline spec. This tag identifies the number of differences that were // found in this diff. Attached to specs for which this automatic diffing is // done. XAkitaNumDifferences Key = "x-akita-num-differences" )
Generic CI tags
const ( // The contents of the TRAVIS_BUILD_WEB_URL environment variable. Attached to // traces and specs derived from a Travis job. XAkitaTravisBuildWebURL Key = "x-akita-travis-build-web-url" // The contents of the TRAVIS_JOB_WEB_URL environment variable. Attached to // traces and specs derived from a Travis job. XAkitaTravisJobWebURL Key = "x-akita-travis-job-web-url" )
Travis tags
const ( // Identifies the git branch from which the trace or spec was derived. // Attached to traces or specs obtained from CI. XAkitaGitBranch Key = "x-akita-git-branch" // Identifies the git commit hash from which the trace or spec was derived. // Attached to traces or specs obtained from CI. // May also be attached to deployment traces if the git commit is known // and applicable. XAkitaGitCommit Key = "x-akita-git-commit" // A link to the git repository. Attached to traces or specs obtained from a // pull/merge request. XAkitaGitRepoURL Key = "x-akita-git-repo-url" )
Generic git tags
const ( // Identifies the GitHub PR number associated with the pull request. Attached // to traces or specs obtained from a GitHub pull request. XAkitaGitHubPR Key = "x-akita-github-pr" // A link to the GitHub pull request. Attached to traces or specs obtained // from a GitHub pull request. XAkitaGitHubPRURL Key = "x-akita-github-pr-url" // Identifies the GitHub repository for which the pull request was made. // Attached to traces or specs obtained from a GitHub pull request. XAkitaGitHubRepo Key = "x-akita-github-repo" )
GitHub tags
const ( XAkitaGitLabProject Key = "x-akita-gitlab-project" XAkitaGitLabMRIID Key = "x-akita-gitlab-mr-iid" )
GitLab tags
const ( // The name of the deployment environment. Suggested values are "production" // or "staging", but may be a user-defined value. XAkitaDeployment Key = "x-akita-deployment" // Used for specifications where the number of witnesses is too large. XAkitaTruncated Key = "x-akita-truncated" // The presence of this tag indicates that the associated model should not be // incorporated into any aggregate models. The value of this tag is ignored. XAkitaDoNotAggregate Key = "x-akita-do-not-aggregate" )
Deployment tags
const ( XAkitaAWSRegion Key = "x-akita-aws-region" // Task and service for agents deployed in ECS. XAkitaECSTask Key = "x-akita-ecs-task" XAkitaECSService Key = "x-akita-ecs-service" )
AWS deployment tags
const ( // Kubernetes namespace // = metadata.namespace in the Downward API XAkitaKubernetesNamespace Key = "x-akita-k8s-namespace" // Node (host) on which the collection agent is running // = spec.nodeName in the Downward API (v1.4.0+) XAkitaKubernetesNode Key = "x-akita-k8s-node" // IP address of the Kubernetes node // = status.hostIP in the Downward API XAkitaKubernetesHostIP Key = "x-akita-k8s-host-ip" // Pod in which the collection agent is running; may be // a dedicated pod using host networking, or an application // pod when running as a sidecar. // = metadata.name in the Downward API XAkitaKubernetesPod Key = "x-akita-k8s-pod" // Pod IP address // = status.podIP in the Downward API (v1.7.0+) XAkitaKubernetesPodIP Key = "x-akita-k8s-pod-ip" // Daemonset used to create the collection agent, if any XAkitaKubernetesDaemonset Key = "x-akita-k8s-daemonset" )
Kubernetes deployment tags
const ( // A comma-separated list of interfaces on which packets were captured. XAkitaDumpInterfacesFlag Key = "x-akita-dump-interfaces-flag" // The packet filter given on the command line to capture packets. XAkitaDumpFilterFlag Key = "x-akita-dump-filter-flag" )
Packet-capture tags
const ( // The contents of the CIRCLE_BUILD_URL environment variable. Attached to // traces and specs derived from a CircleCI job. XAkitaCircleCIBuildURL Key = "x-akita-circleci-build-url" )
CircleCI tags
type ScheduledModelType ¶
type ScheduledModelType = string
const ( // Designates a spec that was created as a "large model". We show the // latest large model on the API Model page in the Akita app. ScheduledLargeModel ScheduledModelType = "large-model" // Designates a spec that was created as a large diffing model. The // most recent large diffing model is used when computing model // differences. ScheduledLargeDiffingModel ScheduledModelType = "large-diffing-model" // Designates a spec that was created as a small diffing model. The // most recent small diffing model is used when computing model // differences. ScheduledSmallDiffingModel ScheduledModelType = "small-diffing-model" )
Valid values for the XAkitaScheduledModelType tag.
type SingletonTags ¶
SingletonTags maps tags to single values.
func FromPairs ¶
func FromPairs(pairs []string) (SingletonTags, error)
Returns a SingletonTags from parsing a list of "key=value" pairs. Produces an error if any element of the list is improperly formatted, or if any key is given more than once. The caller must emit an appropriate warning if any keys are reserved.
func (SingletonTags) AsTags ¶
func (ts SingletonTags) AsTags() Tags
type Source ¶
type Source = string
const ( // Designates a trace or spec that was generated from CI. CISource Source = "ci" // Designates a trace or spec that was derived from a staging or production // deployment. DeploymentSource Source = "deployment" // Designates a trace or spec that whas manually uploaded by the user. UploadedSource Source = "uploaded" // Designates a trace or spec that was manually created by the user. For // example, traces captured from network traffic using the CLI's `apidump` // command are tagged with this source. UserSource Source = "user" )
Valid values for the XAkitaSource tag.
type Tags ¶
Maps tags to sets of values.
func FromPairsMultivalue ¶
Returns a Tags from parsing a list of "key=value" pairs. Produces an error if any element of the list is improperly formatted. The caller must emit an appropriate warning if any keys are reserved.
func (Tags) AsSingletonTags ¶
func (t Tags) AsSingletonTags() SingletonTags
Returns a new tags map with a single value for each tag. If more than one value was present for a given tag, returns the first value in the list. If there are no values in the list, the tag is removed.
func (Tags) Intersect ¶
Removes any tag from t that doesn't exist in t2. For any key k in both t and t2, t[k] is remapped to the intersection of their values. If the intersection is empty, then k is removed.
func (Tags) SetAll ¶
SetAll copies all values from t2 into t. If a key exists in both sets of tags, the value in t is overwritten with that in t2.
func (Tags) SetSingleton ¶
Sets the given key to the given value.
type ValueSet ¶
type ValueSet map[Value]struct{}
func NewValueSet ¶
func (ValueSet) GetFirst ¶
Returns the smallest value in the set. If the set is empty, returns exists == false.
func (ValueSet) MarshalJSON ¶
Marshals ValueSet as a sorted list.
func (*ValueSet) UnmarshalJSON ¶
Parses ValueSet from a list, removing duplicates.