Documentation

Overview

Package restriction is an experimental package for preventing unwanted transport-encoding pairs.

This package is under `x/` and subject to change. See README for details on 'x' packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker interface {
	Check(encoding transport.Encoding, transportName string) error
}

Checker is used by encoding clients, for example Protobuf and Thrift, to prevent unwanted transport-encoding combinations.

Errors indicate whitelisted combinations.

func NewChecker

func NewChecker(tuples ...Tuple) (Checker, error)

NewChecker creates a Checker with a whitelist tuple combinations.

type Tuple

type Tuple struct {
	Transport string
	Encoding  transport.Encoding
}

Tuple defines a combination to whitelist.

func (Tuple) String

func (t Tuple) String() string

String implements fmt.Stringer.

func (Tuple) Validate

func (t Tuple) Validate() error

Validate verifes that a tuple has all fields set.

Source Files