config

package
v0.0.0-...-5445144 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	EvalContext *hcl.EvalContext

	Payload map[string]interface{}
	Headers map[string]string
	Params  map[string]string

	Debug bool
}

func NewContext

func NewContext() *Context

func (*Context) HeaderFunc

func (c *Context) HeaderFunc() function.Function

func (*Context) PayloadFunc

func (c *Context) PayloadFunc() function.Function

func (*Context) URLFunc

func (c *Context) URLFunc() function.Function

type File

type File struct {
	Content  []byte  `hcl:"content"`
	Filename string  `hcl:"filename"`
	Keep     *bool   `hcl:"keep"`
	EnvName  *string `hcl:"envname"`
}

type Hook

type Hook struct {
	ID            string   `hcl:"id,label"`
	Request       *Request `hcl:"request,block"`
	PreExecConfig hcl.Body `hcl:",remain"`

	// Request     *Request
	Constraints *[]bool
	Task        Task
	Response    *Response
}

type HooksConfig

type HooksConfig struct {
	Hooks []Hook `hcl:"hook,block"`
}

type PassFile

type PassFile struct {
	Source       string  `hcl:"source"`
	Name         string  `hcl:"name"`
	Filename     string  `hcl:"filename"`
	Base64Decode *bool   `hcl:"base64decode"`
	Keep         *bool   `hcl:"keep"`
	EnvName      *string `hcl:"envname"`
}

type PostExecConfig

type PostExecConfig struct {
	Response *Response `hcl:"response,block"`
}

type PreExecConfig

type PreExecConfig struct {
	Constraints    *[]bool  `hcl:"constraints"`
	Task           Task     `hcl:"task,block"`
	PostExecConfig hcl.Body `hcl:",remain"`
}

type Request

type Request struct {
	IncomingPayloadContentType *string   `hcl:"force_content_type"`
	JSONStringParameters       *[]string `hcl:"json_parameters"`
	HTTPMethods                *[]string `hcl:"http_methods"`
}

type Response

type Response struct {
	ResponseSuccess     *ResponseSuccess     `hcl:"success,block"`
	ResponseError       *ResponseError       `hcl:"error,block"`
	ResponseUnsatisfied *ResponseUnsatisfied `hcl:"unsatisfied,block"`
}

type ResponseError

type ResponseError struct {
	StatusCode  *int               `hcl:"status_code"`
	ContentType *string            `hcl:"content_type"`
	Body        *string            `hcl:"body"`
	Headers     *map[string]string `hcl:"headers"`
}

type ResponseSuccess

type ResponseSuccess struct {
	StatusCode  *int               `hcl:"status_code"`
	ContentType *string            `hcl:"content_type"`
	Body        *string            `hcl:"body"`
	Headers     *map[string]string `hcl:"headers"`
}

type ResponseUnsatisfied

type ResponseUnsatisfied struct {
	StatusCode  *int               `hcl:"status_code"`
	ContentType *string            `hcl:"content_type"`
	Body        *string            `hcl:"body"`
	Headers     *map[string]string `hcl:"headers"`
}

type Service

type Service struct {
	Debug       *bool     `hcl:"debug"`
	Verbose     *bool     `hcl:"verbose"`
	IP          *string   `hcl:"ip"`
	Port        *int      `hcl:"port"`
	Secure      *bool     `hcl:"secure"`
	User        *string   `hcl:"user"`
	Group       *string   `hcl:"group"`
	LogFile     *string   `hcl:"logfile"`
	NoPanic     *bool     `hcl:"nopanic"`
	PIDFile     *string   `hcl:"pidfile"`
	HTTPMethods *[]string `hcl:"http_methods"`

	EnableXRequestID *bool `hcl:"enable_xrequestid"`
	XRequestIDLimit  *int  `hcl:"xrequestid_limit"`
	ProxyProtocl     *bool `hcl:"proxy_protocol"`

	Hostname          *string   `hcl:"hostname"`
	TLSCertificate    *string   `hcl:"tls_certificate"`
	TLSCertificateKey *string   `hcl:"tls_certificate_key"`
	TLSProtocols      *[]string `hcl:"tls_protocols"`
	TLSCiphers        *[]string `hcl:"tls_ciphers"`

	RawHooks hcl.Body `hcl:",remain"` // See https://hcl.readthedocs.io/en/latest/go_decoding_gohcl.html#partial-decoding

	Hooks []Hook
}

func (Service) Dump

func (s Service) Dump()

type Task

type Task struct {
	ExecuteCommand           []string           `hcl:"cmd"`
	Stdin                    *string            `hcl:"stdin"`
	CommandWorkingDirectory  *string            `hcl:"workdir"`
	PassEnvironmentToCommand *map[string]string `hcl:"env_vars"`
	PassFile                 *PassFile          `hcl:"pass_file,block"`
	File                     *File              `hcl:"create_file,block"`
}

Jump to

Keyboard shortcuts

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