auth

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2020 License: LGPL-3.0 Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

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

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

func (*AuthToken) Serialization

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

type DIDsToRoleParam

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

func (*DIDsToRoleParam) Deserialization

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

func (*DIDsToRoleParam) Serialization

func (this *DIDsToRoleParam) 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

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

func (*DelegateParam) Serialization

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

type DelegateStatus

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

func (*DelegateStatus) Deserialization

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

func (*DelegateStatus) Serialization

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

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

func (*FuncsToRoleParam) Serialization

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

type InitContractAdminParam

type InitContractAdminParam struct {
	AdminOntID []byte
}

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

func (*InitContractAdminParam) Deserialization

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

func (*InitContractAdminParam) Serialization

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

type Status

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

func (*Status) Deserialization

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

func (*Status) Serialization

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

type TransferParam

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

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

func (*TransferParam) Deserialization

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

func (*TransferParam) Serialization

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

type VerifyTokenParam

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

func (*VerifyTokenParam) Deserialization

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

func (*VerifyTokenParam) Serialization

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

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

func (*WithdrawParam) Serialization

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