remote

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2020 License: GPL-3.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(req Request, code int, message string) []byte

Error returs jsonrpc error

Types

type Method

type Method struct {
	Host             string
	Version          string
	Name             string
	RemoteName       string
	Roles            []string
	ParamConverters  []converter.Converter
	ResultConverters []converter.Converter
}

Method struct.

func (*Method) IsGranted

func (m *Method) IsGranted(roles []string) bool

IsGranted check is it possible to use Method with provided roles

type MethodCollection

type MethodCollection struct {
	Methods []Method
}

MethodCollection keeps collection of Methods

func NewMethodCollection

func NewMethodCollection() MethodCollection

NewMethodCollection returns new collection

func (*MethodCollection) Add

func (c *MethodCollection) Add(m Method)

Add adds methos to collection

func (*MethodCollection) Find

func (c *MethodCollection) Find(methodName string) *Method

Find returns method from collection by its name

func (*MethodCollection) Merge

Merge combines collection to a new one

type Remote

type Remote struct {
	Client  *http.Client
	Methods MethodCollection
}

func (*Remote) Call

func (r *Remote) Call(req Request) []byte

Call makes requests to hidden services

type Request

type Request struct {
	ID        interface{}
	Method    string
	Roles     []string
	Headers   map[string][]string
	RawParams gjson.Result
}

Request represents client request

Jump to

Keyboard shortcuts

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