Documentation ¶
Index ¶
- Constants
- func GetPropertyValue(props map[string]string, id string, defValue string) string
- func GetServiceEndpoints() []string
- func SetPropertyValue(props *map[string]string, id string, value string)
- type Downtime
- type Downtimes
- type Map
- type MeshData
- func (meshData *MeshData) AddOperator(op *Operator)
- func (meshData *MeshData) AddServiceType(serviceType *ServiceType)
- func (meshData *MeshData) Clear()
- func (meshData *MeshData) Clone() *MeshData
- func (meshData *MeshData) Compare(other *MeshData) bool
- func (meshData *MeshData) FindOperator(id string) *Operator
- func (meshData *MeshData) FindServiceType(name string) *ServiceType
- func (meshData *MeshData) FromJSON(data string) error
- func (meshData *MeshData) InferMissingData()
- func (meshData *MeshData) Merge(inData *MeshData)
- func (meshData *MeshData) RemoveOperator(op *Operator)
- func (meshData *MeshData) RemoveServiceType(serviceType *ServiceType)
- func (meshData *MeshData) ToJSON() (string, error)
- func (meshData *MeshData) Verify() error
- type Operator
- type Service
- type ServiceEndpoint
- type ServiceType
- type Site
- type Vector
Constants ¶
const ( // EndpointRevad identifies the main Reva Daemon endpoint. EndpointRevad = "REVAD" // EndpointGateway identifies the Gateway endpoint. EndpointGateway = "GATEWAY" // EndpointMetrics identifies the Metrics endpoint. EndpointMetrics = "METRICS" // EndpointWebdav identifies the Webdav endpoint. EndpointWebdav = "WEBDAV" // EndpointOCM identifies the OCM endpoint. EndpointOCM = "OCM" // EndpointMeshDir identifies the Mesh Directory endpoint. EndpointMeshDir = "MESHDIR" )
const ( // StatusDefault signals that this is just regular data. StatusDefault = iota // StatusObsolete flags the mesh data for removal. StatusObsolete )
const ( // PropertyOperator identifies the operator property. PropertyOperator = "operator" // PropertySiteID identifies the site ID property. PropertySiteID = "site_id" // PropertyOrganization identifies the organization property. PropertyOrganization = "organization" // PropertyAPIVersion identifies the API version property. PropertyAPIVersion = "api_version" )
Variables ¶
This section is empty.
Functions ¶
func GetPropertyValue ¶
GetPropertyValue performs a case-insensitive search for the given property.
func GetServiceEndpoints ¶
func GetServiceEndpoints() []string
GetServiceEndpoints returns an array of all service endpoint identifiers.
Types ¶
type Downtime ¶
Downtime represents a single scheduled downtime.
func (*Downtime) InferMissingData ¶
func (dt *Downtime) InferMissingData()
InferMissingData infers missing data from other data where possible.
func (*Downtime) IsExpired ¶
IsExpired returns true of the downtime has expired (i.e., lies in the past).
type Downtimes ¶
type Downtimes struct {
Downtimes []*Downtime
}
Downtimes represents all scheduled downtimes of a site.
func (*Downtimes) InferMissingData ¶
func (dts *Downtimes) InferMissingData()
InferMissingData infers missing data from other data where possible.
func (*Downtimes) IsAnyActive ¶
IsAnyActive returns true if any downtime is currently active.
type MeshData ¶
type MeshData struct { Operators []*Operator ServiceTypes []*ServiceType Status int `json:"-"` }
MeshData holds the entire mesh data managed by Mentix.
func MergeMeshDataMap ¶
MergeMeshDataMap merges all mesh data objects within a map.
func (*MeshData) AddOperator ¶ added in v0.0.14
AddOperator adds a new operator; if an operator with the same ID already exists, the existing one is overwritten.
func (*MeshData) AddServiceType ¶
func (meshData *MeshData) AddServiceType(serviceType *ServiceType)
AddServiceType adds a new service type; if a type with the same name already exists, the existing one is overwritten.
func (*MeshData) Clear ¶
func (meshData *MeshData) Clear()
Clear removes all saved data, leaving an empty mesh.
func (*MeshData) Compare ¶
Compare checks whether the stored data equals the data of another MeshData object.
func (*MeshData) FindOperator ¶ added in v0.0.14
FindOperator searches for an operator with the given ID.
func (*MeshData) FindServiceType ¶
func (meshData *MeshData) FindServiceType(name string) *ServiceType
FindServiceType searches for a service type with the given name.
func (*MeshData) InferMissingData ¶
func (meshData *MeshData) InferMissingData()
InferMissingData infers missing data from other data where possible.
func (*MeshData) RemoveOperator ¶ added in v0.0.14
RemoveOperator removes the provided operator.
func (*MeshData) RemoveServiceType ¶
func (meshData *MeshData) RemoveServiceType(serviceType *ServiceType)
RemoveServiceType removes the provided service type.
type Operator ¶ added in v0.0.14
type Operator struct { ID string Name string Homepage string Email string HelpdeskEmail string SecurityEmail string Sites []*Site Properties map[string]string }
Operator represents a complete operator including its sites managed by Mentix.
func (*Operator) AddSite ¶ added in v0.0.14
AddSite adds a new site; if a site with the same ID already exists, the existing one is overwritten.
func (*Operator) InferMissingData ¶ added in v0.0.14
func (op *Operator) InferMissingData()
InferMissingData infers missing data from other data where possible.
func (*Operator) RemoveSite ¶ added in v0.0.14
RemoveSite removes the provided site.
type Service ¶
type Service struct { *ServiceEndpoint Host string AdditionalEndpoints []*ServiceEndpoint }
Service represents a service managed by Mentix.
func (*Service) FindEndpoint ¶
func (service *Service) FindEndpoint(name string) *ServiceEndpoint
FindEndpoint searches for an additional endpoint with the given name.
func (*Service) InferMissingData ¶
func (service *Service) InferMissingData()
InferMissingData infers missing data from other data where possible.
type ServiceEndpoint ¶
type ServiceEndpoint struct { Type *ServiceType Name string RawURL string URL string IsMonitored bool Properties map[string]string }
ServiceEndpoint represents a service endpoint managed by Mentix.
func (*ServiceEndpoint) InferMissingData ¶
func (serviceEndpoint *ServiceEndpoint) InferMissingData()
InferMissingData infers missing data from other data where possible.
func (*ServiceEndpoint) Verify ¶
func (serviceEndpoint *ServiceEndpoint) Verify() error
Verify checks if the service endpoint data is valid.
type ServiceType ¶
ServiceType represents a service type managed by Mentix.
func (*ServiceType) InferMissingData ¶
func (serviceType *ServiceType) InferMissingData()
InferMissingData infers missing data from other data where possible.
func (*ServiceType) Verify ¶
func (serviceType *ServiceType) Verify() error
Verify checks if the service type data is valid.
type Site ¶
type Site struct { ID string Name string FullName string Organization string Domain string Homepage string Email string Description string Country string CountryCode string Location string Latitude float32 Longitude float32 Services []*Service Properties map[string]string Downtimes Downtimes `json:"-"` }
Site represents a single site managed by Mentix.
func (*Site) AddService ¶
AddService adds a new service; if a service with the same name already exists, the existing one is overwritten.
func (*Site) FindService ¶
FindService searches for a service with the given name.
func (*Site) InferMissingData ¶
func (site *Site) InferMissingData()
InferMissingData infers missing data from other data where possible.
func (*Site) RemoveService ¶
RemoveService removes the provided service.