sign

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: May 5, 2025 License: AGPL-3.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrVersionMismatch = errors.New("sign version mismatch")

Functions

func ContainSignPKG added in v0.1.4

func ContainSignPKG(cmd string) bool

Types

type Client

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

func NewSigner added in v0.1.1

func NewSigner(log func(string, ...any), signServers ...string) *Client

func (*Client) AddRequestHeader

func (c *Client) AddRequestHeader(header map[string]string)

func (*Client) AddSignServer

func (c *Client) AddSignServer(signServers ...string)

func (*Client) GetSignServer

func (c *Client) GetSignServer() []string

func (*Client) Release added in v0.1.4

func (c *Client) Release()

func (*Client) SetAppInfo added in v0.1.3

func (c *Client) SetAppInfo(app *auth.AppInfo)

func (*Client) Sign

func (c *Client) Sign(cmd string, seq uint32, data []byte) (*Response, error)

type HexData added in v0.1.4

type HexData []byte

func (HexData) MarshalJSON added in v0.1.4

func (h HexData) MarshalJSON() ([]byte, error)

func (*HexData) UnmarshalJSON added in v0.1.4

func (h *HexData) UnmarshalJSON(data []byte) error

type Provider

type Provider interface {
	Sign(cmd string, seq uint32, data []byte) (*Response, error)
	AddRequestHeader(header map[string]string)
	AddSignServer(signServers ...string)
	GetSignServer() []string
	SetAppInfo(app *auth.AppInfo)
	Release()
}

type Request added in v0.1.4

type Request struct {
	Cmd string  `json:"cmd"`
	Seq int     `json:"seq"`
	Src HexData `json:"src"`
}

type Response

type Response struct {
	Platform string `json:"platform"`
	Version  string `json:"version"`
	Value    struct {
		Sign  HexData `json:"sign"`
		Extra HexData `json:"extra"`
		Token HexData `json:"token"`
	} `json:"value"`
}

Jump to

Keyboard shortcuts

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