webapi

package
v0.0.0-...-798c9db Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2021 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Success      int = 0
	ReadBodyErr  int = 1
	UnMarshalErr int = 2
	SessErr      int = 3
	NotAPost     int = 4
)

Variables

This section is empty.

Functions

func AccessToken

func AccessToken(w http.ResponseWriter, r *http.Request)

Types

type AccessSig

type AccessSig struct {
	Sig        string `json:"sig"`
	AccesToken string `json:"acces_token"`
}

type ListItem

type ListItem struct {
	Did string `json:"did"`
	T   int64  `json:"t"`
}

type ListUser4Add

type ListUser4Add struct {
	Dids []*ListItem `json:"dids"`
}

type Request

type Request struct {
	AccessToken string      `json:"access_token"`
	Data        interface{} `json:"data,omitempty"`
}

type Response

type Response struct {
	ResultCode int         `json:"result_code"`
	Message    string      `json:"message"`
	Data       interface{} `json:"data,omitempty"`
}

type UserAPI

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

func NewUserAPI

func NewUserAPI(sdb *storage.Storage, admin *config.AdminUser) *UserAPI

func (*UserAPI) AddUser

func (ua *UserAPI) AddUser(w http.ResponseWriter, r *http.Request)

func (*UserAPI) DelUser

func (ua *UserAPI) DelUser(w http.ResponseWriter, r *http.Request)

func (*UserAPI) Ed25519Verify

func (ua *UserAPI) Ed25519Verify(w http.ResponseWriter, r *http.Request)

func (*UserAPI) ListUnAuthorizeUser

func (ua *UserAPI) ListUnAuthorizeUser(w http.ResponseWriter, r *http.Request)

func (*UserAPI) ListUser

func (ua *UserAPI) ListUser(w http.ResponseWriter, r *http.Request)

func (*UserAPI) SigVerify

func (ua *UserAPI) SigVerify(w http.ResponseWriter, r *http.Request)

func (*UserAPI) UserCount

func (ua *UserAPI) UserCount(w http.ResponseWriter, r *http.Request)

type UserDesc

type UserDesc struct {
	Name         string `json:"name"`
	UnitName     string `json:"unit_name"`
	SerialNumber string `json:"serial_number"`
	Did          string `json:"did"`
}

type UserListDetails

type UserListDetails struct {
	PageSize int         `json:"page_size"`
	PageNum  int         `json:"page_num"`
	Uds      []*UserDesc `json:"uds"`
}

type UserReqParam

type UserReqParam struct {
	PageSize int `json:"page_size"`
	PageNum  int `json:"page_num"`
}

type ValidSigResult

type ValidSigResult struct {
	ResultCode  int    `json:"result_code"` //0 success, 1 session not found, 2 signature not correct, 3 other error
	Message     string `json:"message"`
	AccessToken string `json:"access_token"`
}

Jump to

Keyboard shortcuts

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