Documentation ¶
Index ¶
- type Action
- type ActionOptions
- type Authentication
- type Build
- type Control
- type ControlDetails
- type Definition
- type Diff
- type Environment
- type Error
- type Generic
- type Group
- type Import
- type Logger
- type Notification
- type Policy
- type PolicyDocument
- type Profile
- type Project
- type Role
- type Session
- type Statistics
- type User
- type Validation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct { ID int `json:"id"` Type string `json:"type,omitempty"` Status string `json:"status,omitempty"` ResourceID string `json:"resource_id,omitempty"` ResourceType string `json:"resource_type,omitempty"` Options ActionOptions `json:"options,omitempty"` }
Action : stores environment action data
type ActionOptions ¶
type ActionOptions struct { Filters []string `json:"filters,omitempty"` BuildID string `json:"build_id,omitempty"` Environment string `json:"environment,omitempty"` Resolution string `json:"resolution,omitempty"` }
ActionOptions : stores options associated with an action
type Authentication ¶
type Authentication struct {
Token string `json:"token"`
}
Authentication : stores the return token from an authentication request
type Build ¶
type Build struct { ID string `json:"id"` EnvironmentID int `json:"environment_id"` UserID int `json:"user_id"` Username string `json:"user_name"` Type string `json:"type"` Status string `json:"status"` Definition string `json:"definition"` Mapping map[string]interface{} `json:"mapping"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` Validation *Validation `json:"validation"` VPCs []struct { Name string `json:"name"` ID string `json:"vpc_id"` Subnet string `json:"vpc_subnet"` } `json:"vpcs"` Networks []struct { Name string `json:"name"` Subnet string `json:"network_aws_id"` AvailabilityZone string `json:"availability_zone"` } `json:"networks"` Instances []struct { Name string `json:"name"` InstanceAWSID string `json:"instance_aws_id"` PublicIP string `json:"public_ip"` IP string `json:"ip"` } `json:"instances"` Nats []struct { Name string `json:"name"` NatGatewayAWSID string `json:"nat_gateway_aws_id"` IP string `json:"public_ip"` } `json:"nats"` SecurityGroups []struct { Name string `json:"name"` SecurityGroupAWSID string `json:"security_group_aws_id"` } `json:"security_groups"` ELBs []struct { Name string `json:"name"` DNSName string `json:"dns_name"` } `json:"elbs"` RDSClusters []struct { Name string `json:"name"` Endpoint string `json:"endpoint"` } `json:"rds_clusters"` RDSInstances []struct { Name string `json:"name"` Endpoint string `json:"endpoint"` } `json:"rds_instances"` EBSVolumes []struct { Name string `json:"name"` VolumeAWSID string `json:"volume_aws_id"` } `json:"ebs_volumes"` LoadBalancers []struct { ID string `json:"id"` Name string `json:"name"` PublicIP string `json:"public_ip"` } `json:"load_balancers"` VirtualMachines []struct { ID string `json:"id"` Name string `json:"name"` PublicIP string `json:"public_ip"` PrivateIP string `json:"private_ip"` } `json:"virtual_machines"` SQLDatabases []struct { ID string `json:"id"` Name string `json:"name"` ServerName string `json:"server_name"` } `json:"sql_databases"` IamPolicies []struct { ID string `json:"id"` Name string `json:"name"` Path string `json:"path"` } `json:"iam_policies"` IamRoles []struct { ID string `json:"id"` Name string `json:"name"` Path string `json:"path"` Policies []string `json:"policies"` } `json:"iam_roles"` IamInstanceProfiles []struct { ID string `json:"id"` Name string `json:"name"` Path string `json:"path"` Roles []string `json:"roles"` } `json:"iam_instance_profiles"` }
Build : stores build data
type Control ¶
type Control struct { ID string `json:"id"` ProfileID string `json:"profile_id"` Status string `json:"status"` CodeDesc string `json:"code_desc"` RunTime float64 `json:"run_time"` StartTime string `json:"start_time"` Message string `json:"message"` }
Control describes an individual test within a build validation.
func (*Control) PolicyName ¶
PolicyName : Returns the name of the policy that the control is derrived from
type ControlDetails ¶
type ControlDetails struct { ID string `json:"id"` Title string `json:"title"` Description string `json:"desc"` Impact float32 `json:"impact"` References []string `json:"refs"` Tags map[string]string `json:"tags"` Code string `json:"code"` Results []Control `json:"results"` Groups []Group `json:"groups"` Attributes []string `json:"attribues"` SHA256 string `json:"sha256"` SourceLocation struct { Reference string `json:"ref"` Line int `json:"line"` } `json:"source_location"` }
ControlDetails describes additional information about a control
func (*ControlDetails) ControlTitle ¶
func (c *ControlDetails) ControlTitle() string
ControlTitle : returns the name of the control
func (*ControlDetails) Passed ¶
func (c *ControlDetails) Passed() bool
Passed : returns true if all control results are passed
type Definition ¶
Definition : stores basic definition data
func (*Definition) GetID ¶
func (d *Definition) GetID() string
GetID : get the id for the current object
func (*Definition) Load ¶
func (d *Definition) Load(data []byte) error
Load : loads a yaml definition
type Environment ¶
type Environment struct { ID int `json:"id"` ProjectID int `json:"project_id"` Project string `json:"project,omitempty"` Provider string `json:"provider,omitempty"` Name string `json:"name"` Type string `json:"type"` Status string `json:"status"` Options map[string]interface{} `json:"options,omitempty"` Credentials map[string]interface{} `json:"credentials,omitempty"` Schedules map[string]interface{} `json:"schedules,omitempty"` Members []Role `json:"members,omitempty"` }
Environment : stores environment data
func (*Environment) GetID ¶
func (n *Environment) GetID() string
GetID : get the id for the current object
type Error ¶
type Error struct { Message string `json:"message"` Validation *Validation `json:"validation"` }
Error : stores the error response from ernest
type Import ¶
type Import struct {
Filters []string `json:"filters"`
}
Import : stores import preferences
type Logger ¶
type Logger struct { Type string `json:"type"` Logfile string `json:"logfile"` Hostname string `json:"hostname"` Port int `json:"port"` Timeout int `json:"timeout"` Token string `json:"token"` Environment string `json:"environment"` UUID string `json:"uuid"` }
Logger : stores user data
type Notification ¶
type Notification struct { ID int `json:"id"` Name string `json:"name"` Type string `json:"type"` Config string `json:"config"` Sources []string `json:"sources"` }
Notification : stores user data
func (*Notification) GetID ¶
func (n *Notification) GetID() string
GetID : get the id for the current object
type Policy ¶
type Policy struct { ID int `json:"id"` Name string `json:"name"` Revisions []int `json:"revisions"` Environments []string `json:"environments"` }
Policy : stores policy data
type PolicyDocument ¶
type PolicyDocument struct { ID int `json:"id"` PolicyID int `json:"policy_id"` Revision int `json:"revision"` Username string `json:"username"` Definition string `json:"definition"` CreatedAt string `json:"created_at"` }
PolicyDocument : stores policy document data
type Profile ¶
type Profile struct { Supports []string `json:"supports"` Title string `json:"title"` Name string `json:"name"` Controls []ControlDetails `json:"controls"` }
Profile describes the policy document and its test results
func (*Profile) PolicyName ¶
PolicyName : Returns the name of the policy that the control is derrived from
type Project ¶
type Project struct { ID int `json:"id"` Name string `json:"name"` Type string `json:"type"` Credentials map[string]interface{} `json:"credentials,omitempty"` Environments []string `json:"environments,omitempty"` Members []Role `json:"members,omitempty"` }
Project : stores project data
type Role ¶
type Role struct { UID uint `json:"id"` ID string `json:"resource_id"` User string `json:"user_id"` Role string `json:"role"` Resource string `json:"resource_type"` }
Role : stores user data
type Session ¶
type Session struct { ID int `json:"id"` GroupID int `json:"group_id"` Username string `json:"username"` Email string `json:"email"` Admin *bool `json:"admin"` }
Session ...
type Statistics ¶
type Statistics struct {
Duration float64 `json:"duration"`
}
Statistics describes stats for the build validate service.
type User ¶
type User struct { ID int `json:"id"` GroupID int `json:"group_id"` Email string `json:"email"` Username string `json:"username"` Password string `json:"password,omitempty"` OldPassword string `json:"oldpassword,omitempty"` Salt string `json:"salt,omitempty"` Admin bool `json:"admin"` Type string `json:"type"` MFA *bool `json:"mfa"` MFASecret string `json:"mfa_secret"` EnvMemberships []Role `json:"env_memberships"` ProjectMemberships []Role `json:"project_memberships"` Disabled *bool `json:"disabled"` }
User : stores user data
type Validation ¶
type Validation struct { Version string `json:"version"` Controls []Control `json:"controls"` Profiles []Profile `json:"profiles"` Statistics Statistics `json:"statistics"` }
Validation describes a response from the build validate service.
func (*Validation) Passed ¶
func (v *Validation) Passed() bool
Passed : returns true if validation rules passed