Documentation ¶
Index ¶
- Variables
- func NewValidationError(function, message string, err error, errCode string) gobol.Error
- type PropertyType
- type Service
- func (v *Service) GetDefaultTTLTag() (*structs.TSDBTag, int)
- func (v *Service) ParseTTL(value string) (int, string, gobol.Error)
- func (v *Service) StatsValidationError(function, keyset, ip string, sourceType *constants.SourceType, ...)
- func (v *Service) ValidateKeyset(keyset string) gobol.Error
- func (v *Service) ValidateProperty(value string, propertyType PropertyType) gobol.Error
- func (v *Service) ValidateTags(p *structs.TSDBpoint) gobol.Error
- func (v *Service) ValidateTimestamp(timestamp int64) (int64, gobol.Error)
- func (v *Service) ValidateType(p *structs.TSDBpoint, number bool) gobol.Error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrParsingMetric = errCommonValidation("ParsePoint", `Error parsing "metric" from JSON.`, "C01") ErrParsingTimestamp = errCommonValidation("ParsePoint", `Error parsing "timestamp" from JSON.`, "C02") ErrParsingValue = errCommonValidation("ParsePoint", `Error parsing "value" from JSON.`, "C03") ErrParsingText = errCommonValidation("ParsePoint", `Error parsing "text" from JSON.`, "C04") ErrParsingTagKey = errCommonValidation("ParsePoint", `Error parsing tag key from JSON.`, "C05") ErrParsingTagValue = errCommonValidation("ParsePoint", `Error parsing tag value from JSON.`, "C06") ErrNumberTypeExpected = errCommonValidation("ValidateType", `Wrong Format: Field "value" is required.`, "C07") ErrTextTypeExpected = errCommonValidation("ValidateType", `Wrong Format: Field "text" is required.`, "C08") ErrMaxTextValueSize = errCommonValidation("ValidateType", `Wrong Format: Field "text" has exceeded the maximum number of characters allowed`, "C09") ErrNoTags = errCommonValidation("ValidateTags", `Wrong Format: At least one tag is required.`, "C10") ErrDuplicatedTags = errCommonValidation("ValidateTags", `Wrong Format: Duplicated tags.`, "C11") ErrNoUserTags = errCommonValidation("ValidateTags", `Wrong Format: At least one tag other than "ksid" and "ttl" is required.`, "C12") ErrNoKeysetTag = errCommonValidation("ValidateKeyset", `Wrong Format: Tag "ksid" is required.`, "C13") ErrInvalidKeysetFormat = errCommonValidation("ValidateKeyset", `Wrong Format: Field "ksid" has a invalid format.`, "C14") ErrInvalidTagKey = errCommonValidation("ValidateProperty", `Wrong Format: Tag key has a invalid format.`, "C15") ErrInvalidTagValue = errCommonValidation("ValidateProperty", `Wrong Format: Tag value has a invalid format.`, "C16") ErrInvalidMetric = errCommonValidation("ValidateProperty", `Wrong Format: Field "metric" (%s) is not well formed.`, "C17") ErrInvalidPropertyType = errCommonValidation("ValidateProperty", `Property type is not mapped`, "C18") ErrInvalidTTLValue = errCommonValidation("ParseTTL", `Wrong Format: Tag "ttl" must be a positive number.`, "C19") ErrInexistentKeyset = errCommonValidation("ValidateKeyset", `Keyset not exists.`, "C20") ErrMalformedJSON = errCommonValidation("ParsePoint", `JSON is malformed.`, "C21") ErrInvalidTimestamp = errCommonValidation("ValidateTimestamp", `Wrong Format: timestamp has a invalid format.`, "C22") ErrReadingJSONBytes = errCommonValidation("ParsePointArray", "Error reading JSON bytes.", "C23") )
Functions ¶
Types ¶
type PropertyType ¶
type PropertyType uint8
PropertyType - type
const ( // TagKeyType - the tag identifier TagKeyType PropertyType = 1 // TagValueType - the tag identifier TagValueType PropertyType = 2 // MetricType - the metric identifier MetricType PropertyType = 3 )
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service - the validation structure
func New ¶
func New(configuration *structs.ValidationConfiguration, metadataStorage *metadata.Storage, keyspaceTTLMap map[int]string, timelineManager *tlmanager.Instance) (*Service, error)
New - creates a new validation instance
func (*Service) GetDefaultTTLTag ¶
GetDefaultTTLTag - returns the default TTL tag and its integer value
func (*Service) StatsValidationError ¶
func (v *Service) StatsValidationError(function, keyset, ip string, sourceType *constants.SourceType, gerr gobol.Error)
StatsValidationError - accumulates validation data
func (*Service) ValidateKeyset ¶
ValidateKeyset - validates the keyset
func (*Service) ValidateProperty ¶
func (v *Service) ValidateProperty(value string, propertyType PropertyType) gobol.Error
ValidateProperty - validates the property value
func (*Service) ValidateTags ¶
ValidateTags - validates the tags from the point
func (*Service) ValidateTimestamp ¶
ValidateTimestamp - parses the timestamp
Click to show internal directories.
Click to hide internal directories.