pkg

package
v0.0.0-...-3d09631 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BinToStr

func BinToStr(data string) (str string, err error)

func FormatMacAddress

func FormatMacAddress(str string) string

func MapToStruct

func MapToStruct(data map[string]interface{}, typ Params) error

params typ must be empty.

func NewPasswordAuthData

func NewPasswordAuthData(username, password string) []byte

func Sha0Sum

func Sha0Sum(p []byte) []byte

func StructToMap

func StructToMap(params Params) (map[string]interface{}, error)

func ValidateType

func ValidateType(typ string, val interface{}) bool

Types

type Base

type Base struct {
	Jsonrpc string `json:"jsonrpc"`
	Id      int    `json:"id"`
	Name    string `json:"method"`
}

func NewBase

func NewBase(name string) Base

type Id

type Id interface {
	Incl()
	Describe() int
}

Id interface is used for request id

type Method

type Method interface {
	Name() string
	GetId() int
	SetId(id int)
	Parameter() Params
	Marshall() ([]byte, error)
}

Method interface is type for API request

type Params

type Params interface {
	Tags() []string
}

type Response

type Response interface {
	Id() int
	Result() (map[string]interface{}, error)
}

type SHA0

type SHA0 struct {
	// contains filtered or unexported fields
}

func NewSha0Hash

func NewSha0Hash() SHA0

func (*SHA0) Reset

func (s *SHA0) Reset()

func (*SHA0) Sum

func (s *SHA0) Sum() []byte

func (*SHA0) Write

func (s *SHA0) Write(p []byte) (n int)

Jump to

Keyboard shortcuts

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