upstreamheaders

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvHeaders     = "CCWRAP_UPSTREAM_HEADERS"
	EnvHeadersJSON = "CCWRAP_UPSTREAM_HEADERS_JSON"
	EnvHeadersFile = "CCWRAP_UPSTREAM_HEADERS_FILE"
)

Variables

This section is empty.

Functions

func Apply

func Apply(h http.Header, headers map[string]string)

func ExtractFromFlagSettings

func ExtractFromFlagSettings(settings map[string]any) (map[string]string, error)

func Fingerprint

func Fingerprint(headers map[string]string) string

func LoadFile

func LoadFile(path string) (map[string]string, error)

func ParseJSON

func ParseJSON(data []byte, source string) (map[string]string, error)

func ParsePairs

func ParsePairs(pairs []string) (map[string]string, error)

Types

type Config

type Config struct {
	Headers     map[string]string
	Source      string
	Fingerprint string
}

func New

func New(headers map[string]string, source string) (Config, error)

func Resolve

func Resolve(opts ResolveOptions) (Config, []string, error)

type ResolveOptions

type ResolveOptions struct {
	ExplicitPairs       []string
	ExplicitFile        string
	ExplicitFileContent []byte // when set, this content wins over reading from disk
	ParentEnv           []string
	EnvFileContent      []byte // when set, this content wins over reading from disk
	FlagSettings        map[string]any
}

Jump to

Keyboard shortcuts

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