common

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeHTTPClient

func MakeHTTPClient(request *http.Request) (*http.Client, error)

MakeHTTPClient creates a ready to use http client. It configures authentication based on app configuration

Types

type CatalogConfig

type CatalogConfig struct {
	Level                 string // The Log Level
	URL                   string // The URL to your Ansible Tower
	Token                 string // The Token used to authenticate with Ansible Tower
	SkipVerifyCertificate bool   // Skip Certifcate Validation
	MQTTURL               string // The URL for MQTT Server
	GUID                  string // The Client GUID
}

CatalogConfig stores the config parameters for the Catalog Worker

type CatalogInventoryTask

type CatalogInventoryTask struct {
	Input     RequestInput `json:"input"`
	CreatedAt time.Time    `json:"created_at"`
	ID        string       `json:"id"`
	State     string       `json:"state"`
	Status    string       `json:"status"`
	UpdatedAt time.Time    `json:"updated_at"`
}

CatalogInventoryTask stores all attributes of a task retrived from catalog-inventory API

type JobParam

type JobParam struct {
	Method                 string                 `json:"method"`
	HrefSlug               string                 `json:"href_slug"`
	FetchAllPages          bool                   `json:"fetch_all_pages"`
	Params                 map[string]interface{} `json:"params"`
	ApplyFilter            interface{}            `json:"apply_filter"`
	RefreshIntervalSeconds int64                  `json:"refresh_interval_seconds"`
	FetchRelated           []interface{}          `json:"fetch_related"`
	PagePrefix             string                 `json:"page_prefix"`
}

JobParam stores the single parameter set for a job

type MQTTMessage

type MQTTMessage struct {
	URL string `json:"url"`
}

MQTTMessage stores all attributes of the MQTTMessage sent by catalog-inventory API TODO: remove when mqtt client is no longer needed

type Page

type Page struct {
	Data []byte
	Name string
}

Page stores data in a page with a name

type PageWriter

type PageWriter interface {
	Write(name string, b []byte) error
	Flush() error
	FlushErrors(msg []string) error
}

PageWriter is an interface that writes named page contents and flushes

type RequestInput

type RequestInput struct {
	ResponseFormat string     `json:"response_format"`
	UploadURL      string     `json:"upload_url"`
	Jobs           []JobParam `json:"jobs"`
	PreviousSHA    string     `json:"previous_sha"`
	PreviousSize   int64      `json:"previous_size"`
}

RequestInput describes the struct of input attribute in RequestMessage

Jump to

Keyboard shortcuts

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