f399fd2add
CatalogDestinationsOnly is a passthrough that would enable dialing addresses outside of Consul's catalog. However, when this flag is set to true only _connect_ endpoints for services can be dialed. This flag is being renamed to signal that non-Connect endpoints can't be dialed by transparent proxies when the value is set to true.
54 lines
1.1 KiB
Go
54 lines
1.1 KiB
Go
package api
|
|
|
|
import "encoding/json"
|
|
|
|
type MeshConfigEntry struct {
|
|
Namespace string `json:",omitempty"`
|
|
TransparentProxy TransparentProxyMeshConfig `alias:"transparent_proxy"`
|
|
Meta map[string]string `json:",omitempty"`
|
|
CreateIndex uint64
|
|
ModifyIndex uint64
|
|
}
|
|
|
|
type TransparentProxyMeshConfig struct {
|
|
MeshDestinationsOnly bool `alias:"mesh_destinations_only"`
|
|
}
|
|
|
|
func (e *MeshConfigEntry) GetKind() string {
|
|
return MeshConfig
|
|
}
|
|
|
|
func (e *MeshConfigEntry) GetName() string {
|
|
return MeshConfigMesh
|
|
}
|
|
|
|
func (e *MeshConfigEntry) GetNamespace() string {
|
|
return e.Namespace
|
|
}
|
|
|
|
func (e *MeshConfigEntry) GetMeta() map[string]string {
|
|
return e.Meta
|
|
}
|
|
|
|
func (e *MeshConfigEntry) GetCreateIndex() uint64 {
|
|
return e.CreateIndex
|
|
}
|
|
|
|
func (e *MeshConfigEntry) GetModifyIndex() uint64 {
|
|
return e.ModifyIndex
|
|
}
|
|
|
|
// MarshalJSON adds the Kind field so that the JSON can be decoded back into the
|
|
// correct type.
|
|
func (e *MeshConfigEntry) MarshalJSON() ([]byte, error) {
|
|
type Alias MeshConfigEntry
|
|
source := &struct {
|
|
Kind string
|
|
*Alias
|
|
}{
|
|
Kind: MeshConfig,
|
|
Alias: (*Alias)(e),
|
|
}
|
|
return json.Marshal(source)
|
|
}
|