restriction

package
v1.60.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2022 License: MIT Imports: 4 Imported by: 18

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.

Jump to

Keyboard shortcuts

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