transport

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2023 License: GPL-3.0 Imports: 8 Imported by: 2

Documentation

Overview

Package transport provides transports for rpc server

Copyright (C) 2022 Max Nikitenko <moaddib666@gmail.com>

This file is part of go.neonxp.dev/jsonrpc2 project.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTP

type HTTP struct {
	Bind       string
	TLS        *tls.Config
	CORSOrigin string
	Parallel   bool
}

func (*HTTP) Run

func (h *HTTP) Run(ctx context.Context, resolver Resolver) error

type Resolver

type Resolver interface {
	Resolve(ctx context.Context, reader io.Reader, writer io.Writer, isParallel bool)
}

type TCP

type TCP struct {
	Bind     string
	Parallel bool
}

func (*TCP) Run

func (t *TCP) Run(ctx context.Context, resolver Resolver) error

type Transport

type Transport interface {
	Run(ctx context.Context, resolver Resolver) error
}

type UnixSocket added in v1.1.3

type UnixSocket struct {
	Path     string
	Parallel bool
}

func (*UnixSocket) Run added in v1.1.3

func (t *UnixSocket) Run(ctx context.Context, resolver Resolver) error

type WebSocket added in v1.3.0

type WebSocket struct {
	Bind                        string
	TLS                         *tls.Config
	CORSOrigin                  string
	Parallel                    bool
	ReadDeadline, WriteDeadline time.Duration //Set custom timeout for future read and write calls
}

func (*WebSocket) Run added in v1.3.0

func (ws *WebSocket) Run(ctx context.Context, resolver Resolver) error

func (*WebSocket) WithReadDealine added in v1.3.0

func (ws *WebSocket) WithReadDealine() bool

func (*WebSocket) WithWriteDealine added in v1.3.0

func (ws *WebSocket) WithWriteDealine() bool

Jump to

Keyboard shortcuts

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