Documentation
¶
Index ¶
Constants ¶
const (
//ServiceID represents log validator service id.
ServiceID = "validator/log"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AssertRequest ¶
type AssertRequest struct {
LogWaitTimeMs int
LogWaitRetryCount int
Description string
DescriptionTemplate string
Expect []*TypedRecord `required:"true" description:"expected log data"`
}
AssertRequest represents a log assert request
func (*AssertRequest) Init ¶
func (r *AssertRequest) Init() error
Init converts yaml kv pairs to a map if applicable
func (*AssertRequest) Validate ¶
func (r *AssertRequest) Validate() error
Validate check if request is valid
type AssertResponse ¶
type AssertResponse struct {
Validations []*assertly.Validation
}
AssertResponse represents a log assert response
func (*AssertResponse) Assertion ¶
func (r *AssertResponse) Assertion() []*assertly.Validation
Assertion returns description with validation slice
type File ¶
type File struct {
URL string
Content string
Name string
*Type
ProcessingState *ProcessingState
LastModified time.Time
Size int
Records []*Record
IndexedRecords map[string]*Record
Mutex *sync.RWMutex
// contains filtered or unexported fields
}
File represents a log file
func (*File) HasPendingLogs ¶
HasPendingLogs returns true if file has pending validation records
func (*File) PushLogRecord ¶
PushLogRecord appends provided log record to the records.
func (*File) ShiftLogRecord ¶
ShiftLogRecord returns and remove the first log record if present
type IndexedRecord ¶
IndexedRecord represents indexed log record
type ListenRequest ¶
type ListenRequest struct {
FrequencyMs int
Source *location.Resource `required:"true" description:"log location"`
Types []*Type `required:"true" description:"log types"`
}
ListenRequest represents listen for a logs request.
type ListenResponse ¶
type ListenResponse struct {
Meta TypesMeta
}
ListenResponse represents a log validation listen response.
type ProcessingState ¶
ProcessingState represents log processing state
type ResetRequest ¶
type ResetRequest struct {
LogTypes []string `required:"true" description:"log types to reset"`
}
ResetRequest represents a log reset request
type ResetResponse ¶
type ResetResponse struct {
LogFiles []string
}
ResetResponse represents a log reset response
type Type ¶
type Type struct {
Name string `required:"true" description:"log type name"`
Format string `description:"log format"`
Mask string `description:"expected log file mast"`
Exclusion string `description:"if specified, exclusion fragment can not match log record"`
Inclusion string `description:"if specified, inclusion fragment must match log record"`
IndexRegExpr string `description:"provide expression for indexing log messages, in this case position based logging will not apply"` //provide expression for indexing log message, in this case position based logging will not apply
UDF string `description:"registered user defined function to transform content file before applying validation"`
Debug bool `description:"if set, every record appended to validation queue will be listed"`
// contains filtered or unexported fields
}
Type represents a log type
func (*Type) GetIndexExpr ¶
GetIndexExpr returns index expression.
type TypeMeta ¶
TypeMeta represents a log type meta
func NewTypeMeta ¶
NewTypeMeta creates a nre log type meta.
type TypedRecord ¶
type TypedRecord struct {
TagID string `description:"case tag id for reporting and selection"`
Type string `required:"true" description:"log type register with listener"`
Records []interface{}
}
TypedRecord represents an expected log record.