service

package
v0.0.0-...-10d2010 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: GPL-3.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TASK_TICKER      = 10 * time.Second
	OSCORE_AP_METHOD = "calc30xWithDefi"
)
View Source
const ClaimBatchCount = 100
View Source
const (
	TheGraphDefaultTimeout = time.Second * 300
)

Variables

View Source
var (
	PARAM_KEY_APIKEY           = "$API_KEY"
	PARAM_KEY_ARRAY            = "$ARRAY"
	PARAM_KEY_CHAIN            = "$CHAIN_NAME"
	PARAM_KEY_USERADDRESS      = "$USER_ADDRESS"
	PARAM_KEY_ENCRYPTED        = "$ENCRYPTED"
	PARAM_KEY_USER_DID         = "$USER_DID"
	PARAM_DEFAULT_CHAIN_NAME   = "$DEFAULT_CHAIN_NAME"
	PARAM_DEFAULT_USER_ADDRESS = "$DEFAULT_USER_ADDRESS"
	PARAM_AP_DID               = "$AP_DID"
)

Functions

func CheckNonce

func CheckNonce(nonce string) (int, error)

func GenUUID

func GenUUID(action int) string

func InitDidService

func InitDidService(conf *config.SysConfig) error

func InitEmailService

func InitEmailService(mailConfig *config.EmailConfig) error

func InitNftClaimService

func InitNftClaimService(cfg *config.SysConfig)

func InitOntloginServcie

func InitOntloginServcie() error

func InitSysDataService

func InitSysDataService(did string) error

func ParseInputParam

func ParseInputParam(paramStr string, apikey string, userAddrInfos []*store.UserAddressInfo, isPoc bool, apdid string, dptype int, httpMethod string) (string, string, error)

Types

type AssetParam

type AssetParam struct {
	Chain   string `json:"chain"`
	Address string `json:"address"`
}

type DidService

type DidService struct {
	Resolvers map[string]did.Resolver
}
var SysDidService *DidService

func (*DidService) EncryptDataWithDID

func (ds *DidService) EncryptDataWithDID(data []byte, did string) ([]byte, error)

func (*DidService) GetResolver

func (s *DidService) GetResolver(did string) (did.Resolver, error)

func (*DidService) IssueCredential

func (s *DidService) IssueCredential(did string, content string, commit bool) (string, string, error)

func (*DidService) RevokeCredential

func (s *DidService) RevokeCredential(did string, cred string) (string, error)

func (*DidService) SignData

func (ds *DidService) SignData(selfdid string, data []byte) ([]byte, error)

func (*DidService) ValidateSig

func (s *DidService) ValidateSig(did string, msg string, sig string) (bool, error)

type EmailService

type EmailService struct {
	//MailAddress string
	//SMTPPort int
	//Password string
	MailContent string
	MailSubject string
	SelfMail    string
	Server      *mail.SMTPServer
}
var GlobalEmailService *EmailService

func NewEmailService

func NewEmailService(mailConfig *config.EmailConfig) (*EmailService, error)

func (*EmailService) GenerateEmailVCode

func (es *EmailService) GenerateEmailVCode(did, email string) string

func (*EmailService) RequestEmailVCode

func (es *EmailService) RequestEmailVCode(did, email string) (string, error)

func (*EmailService) SendVerificationCode

func (es *EmailService) SendVerificationCode(to string, code string) error

type NftClaimService

type NftClaimService struct {
	// contains filtered or unexported fields
}
var GlobalNftClaimService *NftClaimService

func NewNftClaimService

func NewNftClaimService(cfg *config.SysConfig) *NftClaimService

func (*NftClaimService) DealWithTimeoutNFT

func (ns *NftClaimService) DealWithTimeoutNFT()

func (*NftClaimService) DealWithTimeoutTx

func (ns *NftClaimService) DealWithTimeoutTx()

func (*NftClaimService) GetNFTDetail

func (ns *NftClaimService) GetNFTDetail(chain, contractAddress string, tokenid int64) (smartcontract.OrangeReputationtokenDetail, error)

func (*NftClaimService) GetNFTTimeoutRecord

func (ns *NftClaimService) GetNFTTimeoutRecord() ([]*store.ClaimNFTRecord, error)

func (*NftClaimService) GetUserClaimHash

func (ns *NftClaimService) GetUserClaimHash(userAddr string, nftType int, score uint64) ([]byte, error)

func (*NftClaimService) MonitorTx

func (ns *NftClaimService) MonitorTx()

func (*NftClaimService) SignMsg

func (ns *NftClaimService) SignMsg(msghash []byte) ([]byte, error)

func (*NftClaimService) UpdateClaimNftRecord

func (ns *NftClaimService) UpdateClaimNftRecord(nftRecords []*store.ClaimNFTRecord) error

type OntloginService

type OntloginService struct {
	OntloginSdk *sdk.OntLoginSdk
}
var OloginService *OntloginService

type RespData

type RespData struct {
	Users []*UserData `json:"users,omitempty"`
}

type SysDataService

type SysDataService struct {
	SysDP  *data.HttpDataProvider
	Apikey string
	Did    string
}

this is fixed provided by system

var SysDS *SysDataService

func NewSysDataService

func NewSysDataService(did string) (*SysDataService, error)

func (*SysDataService) AnalyzeUserAssetInfoRes

func (s *SysDataService) AnalyzeUserAssetInfoRes(in []byte) ([]*UserAssetInfo, error)

func (*SysDataService) GetUserAssetsDetail

func (s *SysDataService) GetUserAssetsDetail(did string) ([]*UserAssetInfo, error)

type TaskService

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

func NewTaskService

func NewTaskService() *TaskService

func (*TaskService) CreateCredential

func (ts *TaskService) CreateCredential(task *store.TaskInfo) error

func (*TaskService) DealWithCompositeDP

func (ts *TaskService) DealWithCompositeDP(dm *store.DPMethod, task *store.TaskInfo) error

func (*TaskService) DealWithSingleDP

func (ts *TaskService) DealWithSingleDP(dpdid, dpmethod string, isPOC bool, isLast bool, task *store.TaskInfo) error

func (*TaskService) MonitorDPFinishedTasks

func (ts *TaskService) MonitorDPFinishedTasks()

func (*TaskService) Run

func (ts *TaskService) Run()

type TheGraphService

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

func NewTheGraphService

func NewTheGraphService(cfg *config.GraphConfig) *TheGraphService

func (*TheGraphService) QueryHashByAddressFromChain

func (this *TheGraphService) QueryHashByAddressFromChain(address, chain string) ([]*Token, error)

type Token

type Token struct {
	Id     string `json:"id,omitempty"`
	MintTx string `json:"minttx,omitempty"`
}

type UserAssetInfo

type UserAssetInfo struct {
	Name         string `json:"name"`
	TokenAddress string `json:"tokenAddress"`
	Icon         string `json:"icon"`
	Chain        string `json:"chain"`
	Balance      string `json:"balance"`
	Price        string `json:"price"`
	Value        string `json:"value"`
}

type UserData

type UserData struct {
	Tokens []*Token `json:"tokens,omitempty"`
}

Jump to

Keyboard shortcuts

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