structs

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2022 License: Apache-2.0 Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiCredentials

type ApiCredentials struct {
	Id    string
	Key   string
	Token string
}

type ApiEndpoint

type ApiEndpoint struct {
	// TODO: Should this use the inheritable settings as well?
	Name              string              `yaml:"name"` // Required at all levels.
	Vars              map[string]string   `yaml:"vars,omitempty"`
	SkipEndpoint      map[string][]string `yaml:"skip_endpoint,omitempty"`            // Optional
	Paging            map[string]string   `yaml:"paging,omitempty"`                   // Optional
	Return            string              `yaml:"return,omitempty"`                   // Optional
	UseForConnCheck   bool                `yaml:"use_for_connection_check,omitempty"` // Optional
	SkipForScans      bool                `yaml:"skip_for_scans,omitempty"`           // Optional
	Endpoint          string              `yaml:"endpoint"`                           // Required
	CurrentBaseKey    []string            `yaml:"current_base_key,omitempty"`         // Managing APIs that return a dict => list
	DesiredBaseKey    []string            `yaml:"desired_base_key,omitempty"`         // Managing APIs that return a dict => list
	CurrentErrorKey   []string            `yaml:"current_error_key,omitempty"`        // Managing APIs that return a dict => list
	DesiredErrorKey   []string            `yaml:"desired_error_key,omitempty"`        // Managing APIs that return a dict => list
	EndpointKeyNames  map[string]string   `yaml:"endpoint_key_names,omitempty"`       // Needed for adding endpoint key to sub-endpoint JSON
	EndpointKeyValues map[string]interface{}
	Documentation     string                   `yaml:"documentation,omitempty"` // Optional
	Params            ApiParams                `yaml:"params,flow,omitempty"`   // Optional
	Endpoints         map[string][]ApiEndpoint `yaml:"endpoints,omitempty"`     // Iterating Key => Endpoint
}

func (ApiEndpoint) Copy

func (a ApiEndpoint) Copy() ApiEndpoint

type ApiParams

type ApiParams struct {
	QueryString map[string][]string `yaml:"querystring,flow,omitempty"`
	Header      map[string][]string `yaml:"header,flow,omitempty"`
	Body        map[string][]string `yaml:"body,flow,omitempty"`
}

func (ApiParams) Copy

func (a ApiParams) Copy() ApiParams

type ApiRequest

type ApiRequest struct {
	Settings          ApiRequestInheritableSettings
	Endpoint          string
	CurrentBaseKey    []string // Managing APIs that return a dict => list
	DesiredBaseKey    []string // Managing APIs that return a dict => list
	CurrentErrorKey   []string
	DesiredErrorKey   []string
	EndpointKeyValues map[string]interface{}
	Params            ApiParams

	FullRequest *http.Request
	Client      *http.Client

	AttemptTime time.Time
	Time        time.Time
}

func (ApiRequest) ToComparableApiRequest

func (a ApiRequest) ToComparableApiRequest() ComparableApiRequest

type ApiRequestInheritableSettings

type ApiRequestInheritableSettings struct {
	Name            string
	Vars            map[string]string `yaml:"vars",omitempty`
	Paging          map[string]string
	Plugin          string            `yaml:"plugin"` // Required
	AuthParams      []string          `yaml:"auth_params"`
	PagingParams    []string          `yaml:"paging_params"`
	GlobalVars      map[string]string `yaml:"global_vars,omitempty"`       // Needed for substitutions in all the endpoints
	SkipContentType bool              `yaml:"skip_content_type,omitempty"` // Skip setting content-type header to application/json
}

type ApiRoot

type ApiRoot struct {
	Name            string              `yaml:"name"` // Required
	VarsData        map[string][]string `yaml:"vars_data",omitempty`
	Vars            map[string]string   `yaml:"vars",omitempty`
	Paging          map[string]string   `yaml:"paging"` // Required
	Plugin          string              `yaml:"plugin"` // Required
	AuthParams      []string            `yaml:"auth_params"`
	PagingParams    []string            `yaml:"paging_params"`
	Endpoints       []ApiEndpoint       `yaml:"endpoints"`
	GlobalVars      map[string]string   `yaml:"global_vars",omitempty`       // Needed for substitutions in all the endpoints
	SkipContentType bool                `yaml:"skip_content_type,omitempty"` // Needed for skipping setting Content-Type header to application/json
}

type ComparableApiRequest

type ComparableApiRequest struct {
	Name              string
	Uuid              string
	Endpoint          string
	EndpointKeyValues string
	AttemptTime       time.Time
	Time              time.Time
	ResponseCode      int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL