Documentation
¶
Index ¶
- Constants
- Variables
- func CanonicalHash(p *Profile) (string, error)
- func CanonicalJSON(p *Profile) ([]byte, error)
- func EvaluateRule(values []string, rule Rule) (bool, error)
- func IsValid(findings []Finding) bool
- func MarshalYAML(p *Profile) ([]byte, error)
- func SourceHash(body []byte) string
- func ValidateBytes(body []byte, inventory *Inventory) (*Profile, ValidationResult, error)
- type Evidence
- type FieldInventory
- type FieldMapping
- type FieldRef
- type Finding
- type Inventory
- type LifecycleBucket
- type MethodologyConcept
- type ObjectInventory
- type ObjectMapping
- type Profile
- type Rule
- type ValidationResult
Constants ¶
View Source
const Version = 1
Variables ¶
View Source
var RequiredLifecycleBuckets = []string{"open", "closed_won", "closed_lost", "post_sales", "unknown"}
Functions ¶
func CanonicalHash ¶
func CanonicalJSON ¶
func MarshalYAML ¶
func SourceHash ¶
func ValidateBytes ¶
func ValidateBytes(body []byte, inventory *Inventory) (*Profile, ValidationResult, error)
Types ¶
type Evidence ¶
type Evidence struct {
Source string `json:"source,omitempty" yaml:"source,omitempty"`
MatchedHeuristic string `json:"matched_heuristic,omitempty" yaml:"matched_heuristic,omitempty"`
SampleSize int `json:"sample_size,omitempty" yaml:"sample_size,omitempty"`
DistinctValueCount int `json:"distinct_value_count,omitempty" yaml:"distinct_value_count,omitempty"`
Values []string `json:"values,omitempty" yaml:"values,omitempty"`
}
type FieldInventory ¶
type FieldInventory struct {
ObjectType string `json:"object_type"`
FieldName string `json:"field_name"`
FieldLabel string `json:"field_label,omitempty"`
FieldType string `json:"field_type,omitempty"`
ObjectCount int `json:"object_count"`
PopulatedCount int `json:"populated_count"`
DistinctValues []string `json:"distinct_values,omitempty"`
}
type FieldMapping ¶
type FieldMapping struct {
Object string `json:"object,omitempty" yaml:"object,omitempty"`
Names []string `json:"names,omitempty" yaml:"names,omitempty"`
Confidence float64 `json:"confidence,omitempty" yaml:"confidence,omitempty"`
Evidence *Evidence `json:"evidence,omitempty" yaml:"evidence,omitempty"`
}
type Finding ¶
type Inventory ¶
type Inventory struct {
Objects []ObjectInventory `json:"objects,omitempty"`
Fields []FieldInventory `json:"fields,omitempty"`
}
type LifecycleBucket ¶
type LifecycleBucket struct {
Label string `json:"label,omitempty" yaml:"label,omitempty"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
Order int `json:"order,omitempty" yaml:"order,omitempty"`
Rules []Rule `json:"rules,omitempty" yaml:"rules,omitempty"`
Confidence float64 `json:"confidence,omitempty" yaml:"confidence,omitempty"`
Evidence *Evidence `json:"evidence,omitempty" yaml:"evidence,omitempty"`
}
type MethodologyConcept ¶
type MethodologyConcept struct {
Description string `json:"description,omitempty" yaml:"description,omitempty"`
Aliases []string `json:"aliases,omitempty" yaml:"aliases,omitempty"`
Fields []FieldRef `json:"fields,omitempty" yaml:"fields,omitempty"`
TrackerIDs []string `json:"tracker_ids,omitempty" yaml:"tracker_ids,omitempty"`
ScorecardQuestionIDs []string `json:"scorecard_question_ids,omitempty" yaml:"scorecard_question_ids,omitempty"`
}
type ObjectInventory ¶
type ObjectMapping ¶
type Profile ¶
type Profile struct {
Version int `json:"version" yaml:"version"`
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Objects map[string]ObjectMapping `json:"objects,omitempty" yaml:"objects,omitempty"`
Fields map[string]FieldMapping `json:"fields,omitempty" yaml:"fields,omitempty"`
Lifecycle map[string]LifecycleBucket `json:"lifecycle,omitempty" yaml:"lifecycle,omitempty"`
Methodology map[string]MethodologyConcept `json:"methodology,omitempty" yaml:"methodology,omitempty"`
}
type Rule ¶
type Rule struct {
Field string `json:"field,omitempty" yaml:"field,omitempty"`
Object string `json:"object,omitempty" yaml:"object,omitempty"`
FieldName string `json:"field_name,omitempty" yaml:"field_name,omitempty"`
Op string `json:"op" yaml:"op"`
Value string `json:"value,omitempty" yaml:"value,omitempty"`
Values []string `json:"values,omitempty" yaml:"values,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.