protocol

package
v0.13.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package protocol provides defines APIs of protocol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(p Protocol)

Register registers the protocol to the registry.

func Unregister

func Unregister(name string)

Unregister unregisters the protocol from the registry.

Types

type AssertionBuilder

type AssertionBuilder interface {
	Build(*context.Context) (assert.Assertion, error)
}

AssertionBuilder builds the assertion for the result of Invoke.

type Invoker

type Invoker interface {
	Invoke(*context.Context) (*context.Context, interface{}, error)
}

Invoker is the interface that sends the request and returns response sent from the server.

type Protocol

type Protocol interface {
	Name() string
	UnmarshalRequest([]byte) (Invoker, error)
	UnmarshalExpect([]byte) (AssertionBuilder, error)
}

Protocol is the interface that creates Invoker and AssertionBuilder from YAML.

func Get

func Get(name string) Protocol

Get returns the protocol registered with the given name.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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