2023-03-28 20:12:41 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2019-06-27 17:37:43 +00:00
|
|
|
package api
|
|
|
|
|
2019-08-19 20:31:05 +00:00
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
"time"
|
|
|
|
)
|
2019-06-27 17:37:43 +00:00
|
|
|
|
|
|
|
type ServiceRouterConfigEntry struct {
|
2020-01-24 15:04:58 +00:00
|
|
|
Kind string
|
|
|
|
Name string
|
2021-09-13 21:53:52 +00:00
|
|
|
Partition string `json:",omitempty"`
|
2020-01-24 15:04:58 +00:00
|
|
|
Namespace string `json:",omitempty"`
|
2019-06-27 17:37:43 +00:00
|
|
|
|
2019-08-19 20:31:05 +00:00
|
|
|
Routes []ServiceRoute `json:",omitempty"`
|
2019-06-27 17:37:43 +00:00
|
|
|
|
2020-09-02 19:10:25 +00:00
|
|
|
Meta map[string]string `json:",omitempty"`
|
2019-06-27 17:37:43 +00:00
|
|
|
CreateIndex uint64
|
|
|
|
ModifyIndex uint64
|
|
|
|
}
|
|
|
|
|
2020-09-29 14:11:57 +00:00
|
|
|
func (e *ServiceRouterConfigEntry) GetKind() string { return e.Kind }
|
|
|
|
func (e *ServiceRouterConfigEntry) GetName() string { return e.Name }
|
2021-09-13 21:53:52 +00:00
|
|
|
func (e *ServiceRouterConfigEntry) GetPartition() string { return e.Partition }
|
2020-09-29 14:11:57 +00:00
|
|
|
func (e *ServiceRouterConfigEntry) GetNamespace() string { return e.Namespace }
|
|
|
|
func (e *ServiceRouterConfigEntry) GetMeta() map[string]string { return e.Meta }
|
|
|
|
func (e *ServiceRouterConfigEntry) GetCreateIndex() uint64 { return e.CreateIndex }
|
|
|
|
func (e *ServiceRouterConfigEntry) GetModifyIndex() uint64 { return e.ModifyIndex }
|
2019-06-27 17:37:43 +00:00
|
|
|
|
|
|
|
type ServiceRoute struct {
|
|
|
|
Match *ServiceRouteMatch `json:",omitempty"`
|
|
|
|
Destination *ServiceRouteDestination `json:",omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type ServiceRouteMatch struct {
|
|
|
|
HTTP *ServiceRouteHTTPMatch `json:",omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type ServiceRouteHTTPMatch struct {
|
2020-05-27 18:28:28 +00:00
|
|
|
PathExact string `json:",omitempty" alias:"path_exact"`
|
|
|
|
PathPrefix string `json:",omitempty" alias:"path_prefix"`
|
|
|
|
PathRegex string `json:",omitempty" alias:"path_regex"`
|
2019-06-27 17:37:43 +00:00
|
|
|
|
|
|
|
Header []ServiceRouteHTTPMatchHeader `json:",omitempty"`
|
2020-05-27 18:28:28 +00:00
|
|
|
QueryParam []ServiceRouteHTTPMatchQueryParam `json:",omitempty" alias:"query_param"`
|
2019-07-24 01:56:39 +00:00
|
|
|
Methods []string `json:",omitempty"`
|
2019-06-27 17:37:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type ServiceRouteHTTPMatchHeader struct {
|
|
|
|
Name string
|
|
|
|
Present bool `json:",omitempty"`
|
|
|
|
Exact string `json:",omitempty"`
|
|
|
|
Prefix string `json:",omitempty"`
|
|
|
|
Suffix string `json:",omitempty"`
|
|
|
|
Regex string `json:",omitempty"`
|
|
|
|
Invert bool `json:",omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type ServiceRouteHTTPMatchQueryParam struct {
|
2019-07-24 01:55:26 +00:00
|
|
|
Name string
|
|
|
|
Present bool `json:",omitempty"`
|
|
|
|
Exact string `json:",omitempty"`
|
|
|
|
Regex string `json:",omitempty"`
|
2019-06-27 17:37:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type ServiceRouteDestination struct {
|
2021-12-06 18:58:33 +00:00
|
|
|
Service string `json:",omitempty"`
|
|
|
|
ServiceSubset string `json:",omitempty" alias:"service_subset"`
|
2021-08-25 15:43:07 +00:00
|
|
|
Namespace string `json:",omitempty"`
|
2021-12-06 18:58:33 +00:00
|
|
|
Partition string `json:",omitempty"`
|
2021-08-25 15:43:07 +00:00
|
|
|
PrefixRewrite string `json:",omitempty" alias:"prefix_rewrite"`
|
|
|
|
RequestTimeout time.Duration `json:",omitempty" alias:"request_timeout"`
|
2022-11-29 22:43:15 +00:00
|
|
|
IdleTimeout time.Duration `json:",omitempty" alias:"idle_timeout"`
|
2021-08-25 15:43:07 +00:00
|
|
|
NumRetries uint32 `json:",omitempty" alias:"num_retries"`
|
|
|
|
RetryOnConnectFailure bool `json:",omitempty" alias:"retry_on_connect_failure"`
|
|
|
|
RetryOnStatusCodes []uint32 `json:",omitempty" alias:"retry_on_status_codes"`
|
2022-10-05 17:06:44 +00:00
|
|
|
RetryOn []string `json:",omitempty" alias:"retry_on"`
|
2021-08-25 15:43:07 +00:00
|
|
|
RequestHeaders *HTTPHeaderModifiers `json:",omitempty" alias:"request_headers"`
|
|
|
|
ResponseHeaders *HTTPHeaderModifiers `json:",omitempty" alias:"response_headers"`
|
2019-06-27 17:37:43 +00:00
|
|
|
}
|
|
|
|
|
2019-08-19 20:31:05 +00:00
|
|
|
func (e *ServiceRouteDestination) MarshalJSON() ([]byte, error) {
|
|
|
|
type Alias ServiceRouteDestination
|
|
|
|
exported := &struct {
|
|
|
|
RequestTimeout string `json:",omitempty"`
|
2022-11-29 22:43:15 +00:00
|
|
|
IdleTimeout string `json:",omitempty"`
|
2019-08-19 20:31:05 +00:00
|
|
|
*Alias
|
|
|
|
}{
|
|
|
|
RequestTimeout: e.RequestTimeout.String(),
|
2022-11-29 22:43:15 +00:00
|
|
|
IdleTimeout: e.IdleTimeout.String(),
|
2019-08-19 20:31:05 +00:00
|
|
|
Alias: (*Alias)(e),
|
|
|
|
}
|
|
|
|
if e.RequestTimeout == 0 {
|
|
|
|
exported.RequestTimeout = ""
|
|
|
|
}
|
2022-11-29 22:43:15 +00:00
|
|
|
if e.IdleTimeout == 0 {
|
|
|
|
exported.IdleTimeout = ""
|
|
|
|
}
|
2019-08-19 20:31:05 +00:00
|
|
|
|
|
|
|
return json.Marshal(exported)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e *ServiceRouteDestination) UnmarshalJSON(data []byte) error {
|
|
|
|
type Alias ServiceRouteDestination
|
|
|
|
aux := &struct {
|
|
|
|
RequestTimeout string
|
2022-11-29 22:43:15 +00:00
|
|
|
IdleTimeout string
|
2019-08-19 20:31:05 +00:00
|
|
|
*Alias
|
|
|
|
}{
|
|
|
|
Alias: (*Alias)(e),
|
|
|
|
}
|
|
|
|
if err := json.Unmarshal(data, &aux); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
var err error
|
|
|
|
if aux.RequestTimeout != "" {
|
|
|
|
if e.RequestTimeout, err = time.ParseDuration(aux.RequestTimeout); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
2022-11-29 22:43:15 +00:00
|
|
|
if aux.IdleTimeout != "" {
|
|
|
|
if e.IdleTimeout, err = time.ParseDuration(aux.IdleTimeout); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
2019-08-19 20:31:05 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2019-06-27 17:37:43 +00:00
|
|
|
type ServiceSplitterConfigEntry struct {
|
2020-01-24 15:04:58 +00:00
|
|
|
Kind string
|
|
|
|
Name string
|
2021-09-13 21:53:52 +00:00
|
|
|
Partition string `json:",omitempty"`
|
2020-01-24 15:04:58 +00:00
|
|
|
Namespace string `json:",omitempty"`
|
2019-06-27 17:37:43 +00:00
|
|
|
|
2019-08-19 20:31:05 +00:00
|
|
|
Splits []ServiceSplit `json:",omitempty"`
|
2019-06-27 17:37:43 +00:00
|
|
|
|
2020-09-02 19:10:25 +00:00
|
|
|
Meta map[string]string `json:",omitempty"`
|
2019-06-27 17:37:43 +00:00
|
|
|
CreateIndex uint64
|
|
|
|
ModifyIndex uint64
|
|
|
|
}
|
|
|
|
|
2020-09-29 14:11:57 +00:00
|
|
|
func (e *ServiceSplitterConfigEntry) GetKind() string { return e.Kind }
|
|
|
|
func (e *ServiceSplitterConfigEntry) GetName() string { return e.Name }
|
2021-09-13 21:53:52 +00:00
|
|
|
func (e *ServiceSplitterConfigEntry) GetPartition() string { return e.Partition }
|
2020-09-29 14:11:57 +00:00
|
|
|
func (e *ServiceSplitterConfigEntry) GetNamespace() string { return e.Namespace }
|
|
|
|
func (e *ServiceSplitterConfigEntry) GetMeta() map[string]string { return e.Meta }
|
|
|
|
func (e *ServiceSplitterConfigEntry) GetCreateIndex() uint64 { return e.CreateIndex }
|
|
|
|
func (e *ServiceSplitterConfigEntry) GetModifyIndex() uint64 { return e.ModifyIndex }
|
2019-06-27 17:37:43 +00:00
|
|
|
|
|
|
|
type ServiceSplit struct {
|
2021-12-06 18:58:33 +00:00
|
|
|
Weight float32
|
|
|
|
Service string `json:",omitempty"`
|
|
|
|
ServiceSubset string `json:",omitempty" alias:"service_subset"`
|
2021-08-25 15:43:07 +00:00
|
|
|
Namespace string `json:",omitempty"`
|
2021-12-06 18:58:33 +00:00
|
|
|
Partition string `json:",omitempty"`
|
2021-08-25 15:43:07 +00:00
|
|
|
RequestHeaders *HTTPHeaderModifiers `json:",omitempty" alias:"request_headers"`
|
|
|
|
ResponseHeaders *HTTPHeaderModifiers `json:",omitempty" alias:"response_headers"`
|
2019-06-27 17:37:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type ServiceResolverConfigEntry struct {
|
2020-01-24 15:04:58 +00:00
|
|
|
Kind string
|
|
|
|
Name string
|
2021-09-13 21:53:52 +00:00
|
|
|
Partition string `json:",omitempty"`
|
2020-01-24 15:04:58 +00:00
|
|
|
Namespace string `json:",omitempty"`
|
2019-06-27 17:37:43 +00:00
|
|
|
|
2020-05-27 18:28:28 +00:00
|
|
|
DefaultSubset string `json:",omitempty" alias:"default_subset"`
|
2019-06-27 17:37:43 +00:00
|
|
|
Subsets map[string]ServiceResolverSubset `json:",omitempty"`
|
|
|
|
Redirect *ServiceResolverRedirect `json:",omitempty"`
|
|
|
|
Failover map[string]ServiceResolverFailover `json:",omitempty"`
|
2020-05-27 18:28:28 +00:00
|
|
|
ConnectTimeout time.Duration `json:",omitempty" alias:"connect_timeout"`
|
2023-03-03 14:37:12 +00:00
|
|
|
RequestTimeout time.Duration `json:",omitempty" alias:"request_timeout"`
|
2019-06-27 17:37:43 +00:00
|
|
|
|
2023-04-14 20:42:54 +00:00
|
|
|
// PrioritizeByLocality controls whether the locality of services within the
|
|
|
|
// local partition will be used to prioritize connectivity.
|
|
|
|
PrioritizeByLocality *ServiceResolverPrioritizeByLocality `json:",omitempty" alias:"prioritize_by_locality"`
|
|
|
|
|
2020-08-23 00:05:09 +00:00
|
|
|
// LoadBalancer determines the load balancing policy and configuration for services
|
|
|
|
// issuing requests to this upstream service.
|
2020-09-02 15:10:50 +00:00
|
|
|
LoadBalancer *LoadBalancer `json:",omitempty" alias:"load_balancer"`
|
2020-08-23 00:05:09 +00:00
|
|
|
|
2020-09-02 19:10:25 +00:00
|
|
|
Meta map[string]string `json:",omitempty"`
|
2019-06-27 17:37:43 +00:00
|
|
|
CreateIndex uint64
|
|
|
|
ModifyIndex uint64
|
|
|
|
}
|
|
|
|
|
2019-08-19 20:31:05 +00:00
|
|
|
func (e *ServiceResolverConfigEntry) MarshalJSON() ([]byte, error) {
|
|
|
|
type Alias ServiceResolverConfigEntry
|
|
|
|
exported := &struct {
|
|
|
|
ConnectTimeout string `json:",omitempty"`
|
|
|
|
*Alias
|
|
|
|
}{
|
|
|
|
ConnectTimeout: e.ConnectTimeout.String(),
|
|
|
|
Alias: (*Alias)(e),
|
|
|
|
}
|
|
|
|
if e.ConnectTimeout == 0 {
|
|
|
|
exported.ConnectTimeout = ""
|
|
|
|
}
|
|
|
|
|
|
|
|
return json.Marshal(exported)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e *ServiceResolverConfigEntry) UnmarshalJSON(data []byte) error {
|
|
|
|
type Alias ServiceResolverConfigEntry
|
|
|
|
aux := &struct {
|
|
|
|
ConnectTimeout string
|
|
|
|
*Alias
|
|
|
|
}{
|
|
|
|
Alias: (*Alias)(e),
|
|
|
|
}
|
|
|
|
if err := json.Unmarshal(data, &aux); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
var err error
|
|
|
|
if aux.ConnectTimeout != "" {
|
|
|
|
if e.ConnectTimeout, err = time.ParseDuration(aux.ConnectTimeout); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2020-09-29 14:11:57 +00:00
|
|
|
func (e *ServiceResolverConfigEntry) GetKind() string { return e.Kind }
|
|
|
|
func (e *ServiceResolverConfigEntry) GetName() string { return e.Name }
|
2021-09-13 21:53:52 +00:00
|
|
|
func (e *ServiceResolverConfigEntry) GetPartition() string { return e.Partition }
|
2020-09-29 14:11:57 +00:00
|
|
|
func (e *ServiceResolverConfigEntry) GetNamespace() string { return e.Namespace }
|
|
|
|
func (e *ServiceResolverConfigEntry) GetMeta() map[string]string { return e.Meta }
|
|
|
|
func (e *ServiceResolverConfigEntry) GetCreateIndex() uint64 { return e.CreateIndex }
|
|
|
|
func (e *ServiceResolverConfigEntry) GetModifyIndex() uint64 { return e.ModifyIndex }
|
2019-06-27 17:37:43 +00:00
|
|
|
|
|
|
|
type ServiceResolverSubset struct {
|
|
|
|
Filter string `json:",omitempty"`
|
2020-05-27 18:28:28 +00:00
|
|
|
OnlyPassing bool `json:",omitempty" alias:"only_passing"`
|
2019-06-27 17:37:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type ServiceResolverRedirect struct {
|
|
|
|
Service string `json:",omitempty"`
|
2020-05-27 18:28:28 +00:00
|
|
|
ServiceSubset string `json:",omitempty" alias:"service_subset"`
|
2021-12-06 18:58:33 +00:00
|
|
|
Namespace string `json:",omitempty"`
|
|
|
|
Partition string `json:",omitempty"`
|
|
|
|
Datacenter string `json:",omitempty"`
|
2022-08-29 13:51:32 +00:00
|
|
|
Peer string `json:",omitempty"`
|
2023-03-17 14:48:06 +00:00
|
|
|
SamenessGroup string `json:",omitempty"`
|
2019-06-27 17:37:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type ServiceResolverFailover struct {
|
2021-09-13 21:53:52 +00:00
|
|
|
Service string `json:",omitempty"`
|
|
|
|
ServiceSubset string `json:",omitempty" alias:"service_subset"`
|
|
|
|
// Referencing other partitions is not supported.
|
2023-03-17 14:48:06 +00:00
|
|
|
Namespace string `json:",omitempty"`
|
|
|
|
Datacenters []string `json:",omitempty"`
|
|
|
|
Targets []ServiceResolverFailoverTarget `json:",omitempty"`
|
|
|
|
Policy *ServiceResolverFailoverPolicy `json:",omitempty"`
|
|
|
|
SamenessGroup string `json:",omitempty"`
|
2022-08-15 13:20:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type ServiceResolverFailoverTarget struct {
|
|
|
|
Service string `json:",omitempty"`
|
|
|
|
ServiceSubset string `json:",omitempty" alias:"service_subset"`
|
|
|
|
Partition string `json:",omitempty"`
|
|
|
|
Namespace string `json:",omitempty"`
|
|
|
|
Datacenter string `json:",omitempty"`
|
|
|
|
Peer string `json:",omitempty"`
|
2023-03-03 16:12:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type ServiceResolverFailoverPolicy struct {
|
2023-03-31 19:05:47 +00:00
|
|
|
// Mode specifies the type of failover that will be performed. Valid values are
|
|
|
|
// "sequential", "" (equivalent to "sequential") and "order-by-locality".
|
|
|
|
Mode string `json:",omitempty"`
|
|
|
|
Regions []string `json:",omitempty"`
|
2023-04-14 20:42:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type ServiceResolverPrioritizeByLocality struct {
|
|
|
|
// Mode specifies the type of prioritization that will be performed
|
|
|
|
// when selecting nodes in the local partition.
|
|
|
|
// Valid values are: "" (default "none"), "none", and "failover".
|
|
|
|
Mode string `json:",omitempty"`
|
2019-06-27 17:37:43 +00:00
|
|
|
}
|
2020-08-23 00:05:09 +00:00
|
|
|
|
|
|
|
// LoadBalancer determines the load balancing policy and configuration for services
|
|
|
|
// issuing requests to this upstream service.
|
|
|
|
type LoadBalancer struct {
|
|
|
|
// Policy is the load balancing policy used to select a host
|
|
|
|
Policy string `json:",omitempty"`
|
|
|
|
|
|
|
|
// RingHashConfig contains configuration for the "ring_hash" policy type
|
2020-09-02 15:10:50 +00:00
|
|
|
RingHashConfig *RingHashConfig `json:",omitempty" alias:"ring_hash_config"`
|
2020-08-23 00:05:09 +00:00
|
|
|
|
|
|
|
// LeastRequestConfig contains configuration for the "least_request" policy type
|
2020-09-02 15:10:50 +00:00
|
|
|
LeastRequestConfig *LeastRequestConfig `json:",omitempty" alias:"least_request_config"`
|
2020-08-23 00:05:09 +00:00
|
|
|
|
|
|
|
// HashPolicies is a list of hash policies to use for hashing load balancing algorithms.
|
|
|
|
// Hash policies are evaluated individually and combined such that identical lists
|
|
|
|
// result in the same hash.
|
|
|
|
// If no hash policies are present, or none are successfully evaluated,
|
|
|
|
// then a random backend host will be selected.
|
|
|
|
HashPolicies []HashPolicy `json:",omitempty" alias:"hash_policies"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// RingHashConfig contains configuration for the "ring_hash" policy type
|
|
|
|
type RingHashConfig struct {
|
2020-08-28 20:46:13 +00:00
|
|
|
// MinimumRingSize determines the minimum number of entries in the hash ring
|
2020-08-23 00:05:09 +00:00
|
|
|
MinimumRingSize uint64 `json:",omitempty" alias:"minimum_ring_size"`
|
|
|
|
|
2020-08-28 20:46:13 +00:00
|
|
|
// MaximumRingSize determines the maximum number of entries in the hash ring
|
2020-08-23 00:05:09 +00:00
|
|
|
MaximumRingSize uint64 `json:",omitempty" alias:"maximum_ring_size"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// LeastRequestConfig contains configuration for the "least_request" policy type
|
|
|
|
type LeastRequestConfig struct {
|
|
|
|
// ChoiceCount determines the number of random healthy hosts from which to select the one with the least requests.
|
|
|
|
ChoiceCount uint32 `json:",omitempty" alias:"choice_count"`
|
|
|
|
}
|
|
|
|
|
2020-09-02 15:10:50 +00:00
|
|
|
// HashPolicy defines which attributes will be hashed by hash-based LB algorithms
|
2020-08-23 00:05:09 +00:00
|
|
|
type HashPolicy struct {
|
|
|
|
// Field is the attribute type to hash on.
|
|
|
|
// Must be one of "header","cookie", or "query_parameter".
|
|
|
|
// Cannot be specified along with SourceIP.
|
|
|
|
Field string `json:",omitempty"`
|
|
|
|
|
2020-09-02 15:10:50 +00:00
|
|
|
// FieldValue is the value to hash.
|
2020-08-23 00:05:09 +00:00
|
|
|
// ie. header name, cookie name, URL query parameter name
|
|
|
|
// Cannot be specified along with SourceIP.
|
2020-09-02 15:10:50 +00:00
|
|
|
FieldValue string `json:",omitempty" alias:"field_value"`
|
|
|
|
|
|
|
|
// CookieConfig contains configuration for the "cookie" hash policy type.
|
|
|
|
CookieConfig *CookieConfig `json:",omitempty" alias:"cookie_config"`
|
2020-08-23 00:05:09 +00:00
|
|
|
|
2020-09-02 15:10:50 +00:00
|
|
|
// SourceIP determines whether the hash should be of the source IP rather than of a field and field value.
|
|
|
|
// Cannot be specified along with Field or FieldValue.
|
|
|
|
SourceIP bool `json:",omitempty" alias:"source_ip"`
|
2020-08-23 00:05:09 +00:00
|
|
|
|
|
|
|
// Terminal will short circuit the computation of the hash when multiple hash policies are present.
|
|
|
|
// If a hash is computed when a Terminal policy is evaluated,
|
|
|
|
// then that hash will be used and subsequent hash policies will be ignored.
|
|
|
|
Terminal bool `json:",omitempty"`
|
|
|
|
}
|
2020-09-02 15:10:50 +00:00
|
|
|
|
|
|
|
// CookieConfig contains configuration for the "cookie" hash policy type.
|
|
|
|
// This is specified to have Envoy generate a cookie for a client on its first request.
|
|
|
|
type CookieConfig struct {
|
2020-09-12 00:34:03 +00:00
|
|
|
// Generates a session cookie with no expiration.
|
|
|
|
Session bool `json:",omitempty"`
|
|
|
|
|
|
|
|
// TTL for generated cookies. Cannot be specified for session cookies.
|
2020-09-02 15:10:50 +00:00
|
|
|
TTL time.Duration `json:",omitempty"`
|
|
|
|
|
|
|
|
// The path to set for the cookie
|
|
|
|
Path string `json:",omitempty"`
|
|
|
|
}
|
2021-08-25 15:43:07 +00:00
|
|
|
|
|
|
|
// HTTPHeaderModifiers is a set of rules for HTTP header modification that
|
|
|
|
// should be performed by proxies as the request passes through them. It can
|
|
|
|
// operate on either request or response headers depending on the context in
|
|
|
|
// which it is used.
|
|
|
|
type HTTPHeaderModifiers struct {
|
|
|
|
// Add is a set of name -> value pairs that should be appended to the request
|
|
|
|
// or response (i.e. allowing duplicates if the same header already exists).
|
|
|
|
Add map[string]string `json:",omitempty"`
|
|
|
|
|
|
|
|
// Set is a set of name -> value pairs that should be added to the request or
|
|
|
|
// response, overwriting any existing header values of the same name.
|
|
|
|
Set map[string]string `json:",omitempty"`
|
|
|
|
|
|
|
|
// Remove is the set of header names that should be stripped from the request
|
|
|
|
// or response.
|
|
|
|
Remove []string `json:",omitempty"`
|
|
|
|
}
|