rycli

package module
v0.0.0-...-f08af8c Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_pbase_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Client

type Client struct {
	BaseURL string
	// contains filtered or unexported fields
}

Client basic struct that contains all method to work with JSON-RPC 2.0 protocol

func NewClient

func NewClient() *Client

NewClient returns new configured Client to start work with JSON-RPC 2.0 protocol

func (*Client) Call

func (cl *Client) Call(method string, args, result interface{}) error

Call run remote procedure on JSON-RPC 2.0 API with parsing answer to provided structure or interface

func (*Client) DisableHeaderNamesNormalizing

func (cl *Client) DisableHeaderNamesNormalizing(fix bool)

DisableHeaderNamesNormalizing setting normalize headers or not

func (*Client) SetBaseURL

func (cl *Client) SetBaseURL(baseURL string)

SetBaseURL setting basic url for API

func (*Client) SetBasicAuthHeader

func (cl *Client) SetBasicAuthHeader(login string, password string)

// DeleteCustomHeader delete custom header

func (cl *Client) DeleteCustomHeader(headerName string) {
	delete(cl.customHeaders, headerName)
}

SetBasicAuthHeader setting basic auth header

func (*Client) SetClientTimeout

func (cl *Client) SetClientTimeout(duration time.Duration)

SetClientTimeout this method sets globally for client its timeout

func (*Client) SetCustomAuthHeader

func (cl *Client) SetCustomAuthHeader(authType string, authData string)

SetCustomAuthHeader setting custom auth header with type of auth and auth data

func (*Client) SetCustomHeader

func (cl *Client) SetCustomHeader(headerName, headerValue string)

SetCustomHeader setting custom header

type ErrorCode

type ErrorCode int

ErrorCode type for error codes

type PBase

type PBase struct {
	Err  string `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"`
	Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*PBase) Descriptor deprecated

func (*PBase) Descriptor() ([]byte, []int)

Deprecated: Use PBase.ProtoReflect.Descriptor instead.

func (*PBase) GetData

func (x *PBase) GetData() []byte

func (*PBase) GetErr

func (x *PBase) GetErr() string

func (*PBase) ProtoMessage

func (*PBase) ProtoMessage()

func (*PBase) ProtoReflect

func (x *PBase) ProtoReflect() protoreflect.Message

func (*PBase) Reset

func (x *PBase) Reset()

func (*PBase) String

func (x *PBase) String() string

Jump to

Keyboard shortcuts

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