protocol

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: Apache-2.0 Imports: 6 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.

type QueryOptionsProvider added in v0.17.0

type QueryOptionsProvider interface {
	QueryOptions() []query.Option
}

QueryOptionsProvider is the interface that provides custom querying options.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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