esssdk

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

README

gfa-ess-sdk-go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client represents GFA-ESS client.

func NewClient

func NewClient(opts *Options) (c *Client, err error)

NewClient creates an instance of Client.

func (*Client) CreateDocument

func (c *Client) CreateDocument(doc *Document) (err error)

CreateDocument creates an ess document.

func (*Client) CreatePersonalSeal

func (c *Client) CreatePersonalSeal(seal *PersonalSeal) (err error)

CreatePersonalSeal creates an ess seal.

func (*Client) CreateSeal

func (c *Client) CreateSeal(seal *Seal) (err error)

CreateSeal creates an ess seal.

func (*Client) CreateUser

func (c *Client) CreateUser(user *User) (err error)

CreateUser creates an ess user.

func (*Client) CreateUserCert

func (c *Client) CreateUserCert(userID string) (certSN string, err error)

CreateUserCert creates the certification for an ess user.

func (*Client) GetToken

func (c *Client) GetToken() (token string, err error)

GetToken gets access token from ess service.

func (*Client) SignDocumentForKeyword added in v0.2.0

func (c *Client) SignDocumentForKeyword(si *KeywordSignInfo) (signedDocURL string, err error)

SignDocumentForKeyword signs an ess document for specified keyword.

func (*Client) SignDocumentForPosition added in v0.2.0

func (c *Client) SignDocumentForPosition(si *PositionSignInfo) (signedDocURL string, err error)

SignDocumentForPosition signs an ess document for specified postion.

type DocType

type DocType int

DocType resprents doc type.

const (
	PDFDocType DocType = 2
	OFDDocType DocType = 3
)

DocType enum

type Document

type Document struct {
	DocName          string  `json:"docName"`
	DocType          DocType `json:"docType"`
	DocContentBase64 string  `json:"docContentBase64"`
	UserID           string  `json:"userId"`
	UUID             string  `json:"uuid"`
}

Document represents an ess document.

type KeywordSignInfo added in v0.2.0

type KeywordSignInfo struct {
	DocID   string `json:"docId"`
	SealID  string `json:"sealId"`
	Keyword string `json:"keyword"`
	Scope   int    `json:"scope"`
	Start   int    `json:"start"`
	End     int    `json:"end"`
	Zoom    int    `json:"zoom"`
}

KeywordSignInfo represents the keyword signing info to an ess document.

type Options

type Options struct {
	// 接入方编码
	AppKey string

	// 接入方密钥
	AppSecret string

	// 电子印章服务地址
	Addr string
}

Options represents the client options.

type PersonalSeal

type PersonalSeal struct {
	Name   string `json:"name"`
	CertSN string `json:"certSN"`
	UUID   string `json:"uuid"`
}

PersonalSeal represents an ess personal seal.

type PositionSignInfo added in v0.2.0

type PositionSignInfo struct {
	DocID      string `json:"docId"`
	SealID     string `json:"sealId"`
	PageNumber string `json:"pageNumber"`
	X          int    `json:"x"`
	Y          int    `json:"y"`
	Zoom       int    `json:"zoom"`
	Reason     string `json:"reason"`
	Remark     string `json:"remark"`
}

PositionSignInfo represents the position signing info to an ess document.

type Response

type Response struct {
	Code int         `json:"code"`
	Msg  string      `json:"msg"`
	Data interface{} `json:"data"`
}

Response represents the response of http request.

type Seal

type Seal struct {
	ImgData string `json:"imgData"`
	ImgType string `json:"imgType"`
	Name    string `json:"name"`
	UserID  string `json:"userId"`
	UUID    string `json:"uuid"`
}

Seal represents an ess seal.

type User

type User struct {
	Email    string `json:"email"`
	Mobile   string `json:"mobile"`
	UserName string `json:"userName"`
	RealName string `json:"realName"`
	UnitID   string `json:"unitId"`
	UUID     string `json:"uuid"`
}

User represents an ess user.

Jump to

Keyboard shortcuts

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