Help us shape the future of Go! Take the 2026 Go Developer Survey

sign

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 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

This section is empty.

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) 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 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)
}

type Response

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

Jump to

Keyboard shortcuts

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