config

package
v0.188.3 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CAConfig

type CAConfig struct {
	// Cert is the PEM encoded certificate.
	Cert string `json:"cert"`
	// PrivateKey is the PEM encoded private key.
	PrivateKey string `json:"private_key"`
}

CAConfig is the paths to the Certificate Authority key pair.

type Config

type Config struct {
	// Storage is the storage configuration(s).
	Storage []*StorageConfig `json:"storage"`
	// Address is the address for the proxy server to listen on.
	Address string `json:"address"`
	// Hosts is a list of hosts that are allowed to be recorded and played back.
	Hosts []string `json:"hosts"`
	// CAConfig is the paths to the Certificate Authority key pair.
	CAConfig CAConfig `json:"ca_keypair"`
}

Config is the configuration for the proxy.

func LoadConfig

func LoadConfig(path string) (*Config, error)

LoadConfig loads the configuration from a JSON file path.

type StorageConfig

type StorageConfig struct {
	// Type is the type of storage.
	Type StorageType `json:"type"`
	// Path is the path to the storage file (valid for HAR and OpenAPI).
	Path string `json:"path"`
}

StorageConfig defines the storage configuration for the proxy.

type StorageType

type StorageType string

StorageType defines the type of storage used by the proxy.

const (
	// StorageTypeHAR is the HAR file storage type.
	StorageTypeHAR StorageType = "har"
	// StorageTypeOpenAPI is the OpenAPI file storage type (JSON or YAML).
	StorageTypeOpenAPI StorageType = "openapi"
)

Jump to

Keyboard shortcuts

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