auth

package
v1.10.1-sdk Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2020 License: LGPL-3.0 Imports: 13 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PreAdmin          = []byte{0x01}
	PreRoleFunc       = []byte{0x02}
	PreRoleToken      = []byte{0x03}
	PreDelegateStatus = []byte{0x04}
)

Functions

func AssignFuncsToRole

func AssignFuncsToRole(native *native.NativeService) ([]byte, error)

func AssignOntIDsToRole

func AssignOntIDsToRole(native *native.NativeService) ([]byte, error)

func Delegate

func Delegate(native *native.NativeService) ([]byte, error)

func Init

func Init()

func InitContractAdmin

func InitContractAdmin(native *native.NativeService) ([]byte, error)

func RegisterAuthContract

func RegisterAuthContract(native *native.NativeService)

func StringsDedupAndSort added in v1.8.0

func StringsDedupAndSort(s []string) []string

remove duplicates in the slice of string and sorts the slice in increasing order.

func Transfer

func Transfer(native *native.NativeService) ([]byte, error)

func VerifyToken

func VerifyToken(native *native.NativeService) ([]byte, error)

func Withdraw

func Withdraw(native *native.NativeService) ([]byte, error)

Types

type AuthToken

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

func (*AuthToken) Deserialization added in v1.8.1

func (this *AuthToken) Deserialization(source *common.ZeroCopySource) error

func (*AuthToken) Serialization added in v1.8.1

func (this *AuthToken) Serialization(sink *common.ZeroCopySink)

type DelegateParam

type DelegateParam struct {
	ContractAddr common.Address
	From         []byte
	To           []byte
	Role         []byte
	Period       uint64
	Level        uint64
	KeyNo        uint64
}

func (*DelegateParam) Deserialization added in v1.8.1

func (this *DelegateParam) Deserialization(source *common.ZeroCopySource) error

func (*DelegateParam) Serialization added in v1.8.1

func (this *DelegateParam) Serialization(sink *common.ZeroCopySink)

type DelegateStatus

type DelegateStatus struct {
	AuthToken
	// contains filtered or unexported fields
}

func (*DelegateStatus) Deserialization added in v1.8.1

func (this *DelegateStatus) Deserialization(source *common.ZeroCopySource) error

func (*DelegateStatus) Serialization added in v1.8.1

func (this *DelegateStatus) Serialization(sink *common.ZeroCopySink)

type FuncsToRoleParam

type FuncsToRoleParam struct {
	ContractAddr common.Address
	AdminOntID   []byte
	Role         []byte
	FuncNames    []string
	KeyNo        uint64
}

**********************************************

func (*FuncsToRoleParam) Deserialization added in v1.8.1

func (this *FuncsToRoleParam) Deserialization(source *common.ZeroCopySource) error

func (*FuncsToRoleParam) Serialization added in v1.8.1

func (this *FuncsToRoleParam) Serialization(sink *common.ZeroCopySink)

type InitContractAdminParam

type InitContractAdminParam struct {
	AdminOntID []byte
}

**********************************************

func (*InitContractAdminParam) Deserialization added in v1.8.1

func (this *InitContractAdminParam) Deserialization(source *common.ZeroCopySource) error

func (*InitContractAdminParam) Serialization added in v1.8.1

func (this *InitContractAdminParam) Serialization(sink *common.ZeroCopySink)

type OntIDsToRoleParam

type OntIDsToRoleParam struct {
	ContractAddr common.Address
	AdminOntID   []byte
	Role         []byte
	Persons      [][]byte
	KeyNo        uint64
}

func (*OntIDsToRoleParam) Deserialization added in v1.8.1

func (this *OntIDsToRoleParam) Deserialization(source *common.ZeroCopySource) error

func (*OntIDsToRoleParam) Serialization added in v1.8.1

func (this *OntIDsToRoleParam) Serialization(sink *common.ZeroCopySink)

type Status

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

func (*Status) Deserialization added in v1.8.1

func (this *Status) Deserialization(source *common.ZeroCopySource) error

func (*Status) Serialization added in v1.8.1

func (this *Status) Serialization(sink *common.ZeroCopySink)

type TransferParam

type TransferParam struct {
	ContractAddr  common.Address
	NewAdminOntID []byte
	KeyNo         uint64
}

**********************************************

func (*TransferParam) Deserialization added in v1.8.1

func (this *TransferParam) Deserialization(source *common.ZeroCopySource) error

func (*TransferParam) Serialization added in v1.8.1

func (this *TransferParam) Serialization(sink *common.ZeroCopySink)

type VerifyTokenParam

type VerifyTokenParam struct {
	ContractAddr common.Address
	Caller       []byte
	Fn           string
	KeyNo        uint64
}

func (*VerifyTokenParam) Deserialization added in v1.8.1

func (this *VerifyTokenParam) Deserialization(source *common.ZeroCopySource) error

func (*VerifyTokenParam) Serialization added in v1.8.1

func (this *VerifyTokenParam) Serialization(sink *common.ZeroCopySink)

type WithdrawParam

type WithdrawParam struct {
	ContractAddr common.Address
	Initiator    []byte
	Delegate     []byte
	Role         []byte
	KeyNo        uint64
}

func (*WithdrawParam) Deserialization added in v1.8.1

func (this *WithdrawParam) Deserialization(source *common.ZeroCopySource) error

func (*WithdrawParam) Serialization added in v1.8.1

func (this *WithdrawParam) Serialization(sink *common.ZeroCopySink)

Jump to

Keyboard shortcuts

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