Documentation ¶
Overview ¶
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.
* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Constants
- func GetAttributeByKey(srvc *native.NativeService) ([]byte, error)
- func GetAttributes(srvc *native.NativeService) ([]byte, error)
- func GetAttributesJson(srvc *native.NativeService) ([]byte, error)
- func GetControllerJson(srvc *native.NativeService) ([]byte, error)
- func GetDDO(srvc *native.NativeService) ([]byte, error)
- func GetDocumentJson(srvc *native.NativeService) ([]byte, error)
- func GetKeyState(srvc *native.NativeService) ([]byte, error)
- func GetPublicKeyByID(srvc *native.NativeService) ([]byte, error)
- func GetPublicKeys(srvc *native.NativeService) ([]byte, error)
- func GetPublicKeysJson(srvc *native.NativeService) ([]byte, error)
- func GetServiceJson(srvc *native.NativeService) ([]byte, error)
- func Init()
- func RegisterIDContract(srvc *native.NativeService)
- func SerializeSigners(s []Signer) []byte
- type AddNewAuthKeyParam
- type Context
- type Contexts
- type Document
- type Group
- type GroupJson
- type NewPublicKey
- type ProofParam
- type RemoveAuthKeyParam
- type SearchServiceParam
- type Service
- type ServiceParam
- type ServiceRemoveParam
- type Services
- type SetAuthKeyParam
- type SetKeyAccessParam
- type Signer
Constants ¶
const ( MAX_KEY_SIZE = 80 MAX_TYPE_SIZE = 64 MAX_VALUE_SIZE = 512 * 1024 MAX_NUM = 100 )
const ( FIELD_VERSION byte = 0 FLAG_VERSION byte = 0x01 FIELD_PK byte = 1 FIELD_ATTR byte = 2 FIELD_RECOVERY byte = 3 FIELD_CONTROLLER byte = 4 FIELD_SERVICE byte = 5 FIELD_CREATED byte = 6 FIELD_UPDATED byte = 7 FIELD_PROOF byte = 8 FIELD_CONTEXT byte = 9 )
const MAX_DEPTH = 8
const (
OWNER_TOTAL_SIZE = 1024 * 1024 // 1MB
)
Variables ¶
This section is empty.
Functions ¶
func GetAttributeByKey ¶ added in v1.10.0
func GetAttributeByKey(srvc *native.NativeService) ([]byte, error)
func GetAttributes ¶
func GetAttributes(srvc *native.NativeService) ([]byte, error)
func GetAttributesJson ¶ added in v1.10.0
func GetAttributesJson(srvc *native.NativeService) ([]byte, error)
func GetControllerJson ¶ added in v1.10.0
func GetControllerJson(srvc *native.NativeService) ([]byte, error)
func GetDocumentJson ¶ added in v1.10.0
func GetDocumentJson(srvc *native.NativeService) ([]byte, error)
func GetKeyState ¶
func GetKeyState(srvc *native.NativeService) ([]byte, error)
func GetPublicKeyByID ¶
func GetPublicKeyByID(srvc *native.NativeService) ([]byte, error)
func GetPublicKeysJson ¶ added in v1.10.0
func GetPublicKeysJson(srvc *native.NativeService) ([]byte, error)
func GetServiceJson ¶ added in v1.10.0
func GetServiceJson(srvc *native.NativeService) ([]byte, error)
func RegisterIDContract ¶
func RegisterIDContract(srvc *native.NativeService)
func SerializeSigners ¶ added in v1.8.2
Types ¶
type AddNewAuthKeyParam ¶ added in v1.10.0
type AddNewAuthKeyParam struct { OntId []byte NewPublicKey *NewPublicKey SignIndex uint32 }
func (*AddNewAuthKeyParam) Deserialization ¶ added in v1.10.0
func (this *AddNewAuthKeyParam) Deserialization(source *common.ZeroCopySource) error
func (*AddNewAuthKeyParam) Serialization ¶ added in v1.10.0
func (this *AddNewAuthKeyParam) Serialization(sink *common.ZeroCopySink)
type Context ¶ added in v1.10.0
func (*Context) Deserialization ¶ added in v1.10.0
func (this *Context) Deserialization(source *common.ZeroCopySource) error
func (*Context) Serialization ¶ added in v1.10.0
func (this *Context) Serialization(sink *common.ZeroCopySink)
type Contexts ¶ added in v1.10.0
type Contexts [][]byte
func (*Contexts) Deserialization ¶ added in v1.10.0
func (contexts *Contexts) Deserialization(source *common.ZeroCopySource) error
func (*Contexts) Serialization ¶ added in v1.10.0
func (contexts *Contexts) Serialization(sink *common.ZeroCopySink)
type Document ¶ added in v1.10.0
type Document struct { Contexts []string `json:"@context"` Id string `json:"id"` PublicKey []*publicKeyJson `json:"publicKey"` Authentication []interface{} `json:"authentication"` Controller interface{} `json:"controller"` Recovery *GroupJson `json:"recovery"` Service []*serviceJson `json:"service"` Attribute []*attributeJson `json:"attribute"` Created uint32 `json:"created"` Updated uint32 `json:"updated"` Proof string `json:"proof"` }
type Group ¶ added in v1.8.1
type Group struct { Members []interface{} `json:"members"` Threshold uint `json:"threshold"` }
Group defines a group control logic
type GroupJson ¶ added in v1.10.0
type GroupJson struct { Members []interface{} `json:"members"` Threshold uint `json:"threshold"` }
type NewPublicKey ¶ added in v1.10.0
type NewPublicKey struct {
// contains filtered or unexported fields
}
func (*NewPublicKey) Deserialization ¶ added in v1.10.0
func (this *NewPublicKey) Deserialization(source *common.ZeroCopySource) error
func (*NewPublicKey) Serialization ¶ added in v1.10.0
func (this *NewPublicKey) Serialization(sink *common.ZeroCopySink)
type ProofParam ¶ added in v1.10.0
func (*ProofParam) Deserialization ¶ added in v1.10.0
func (this *ProofParam) Deserialization(source *common.ZeroCopySource) error
func (*ProofParam) Serialization ¶ added in v1.10.0
func (this *ProofParam) Serialization(sink *common.ZeroCopySink)
type RemoveAuthKeyParam ¶ added in v1.10.0
func (*RemoveAuthKeyParam) Deserialization ¶ added in v1.10.0
func (this *RemoveAuthKeyParam) Deserialization(source *common.ZeroCopySource) error
func (*RemoveAuthKeyParam) Serialization ¶ added in v1.10.0
func (this *RemoveAuthKeyParam) Serialization(sink *common.ZeroCopySink)
type SearchServiceParam ¶ added in v1.10.0
func (*SearchServiceParam) Deserialization ¶ added in v1.10.0
func (this *SearchServiceParam) Deserialization(source *common.ZeroCopySource) error
func (*SearchServiceParam) Serialization ¶ added in v1.10.0
func (this *SearchServiceParam) Serialization(sink *common.ZeroCopySink)
type Service ¶ added in v1.10.0
func (*Service) Deserialization ¶ added in v1.10.0
func (this *Service) Deserialization(source *common.ZeroCopySource) error
func (*Service) Serialization ¶ added in v1.10.0
func (this *Service) Serialization(sink *common.ZeroCopySink)
type ServiceParam ¶ added in v1.10.0
type ServiceParam struct { OntId []byte ServiceId []byte Type []byte ServiceEndpint []byte Index uint32 }
func (*ServiceParam) Deserialization ¶ added in v1.10.0
func (this *ServiceParam) Deserialization(source *common.ZeroCopySource) error
func (*ServiceParam) Serialization ¶ added in v1.10.0
func (this *ServiceParam) Serialization(sink *common.ZeroCopySink)
type ServiceRemoveParam ¶ added in v1.10.0
func (*ServiceRemoveParam) Deserialization ¶ added in v1.10.0
func (this *ServiceRemoveParam) Deserialization(source *common.ZeroCopySource) error
func (*ServiceRemoveParam) Serialization ¶ added in v1.10.0
func (this *ServiceRemoveParam) Serialization(sink *common.ZeroCopySink)
type Services ¶ added in v1.10.0
type Services []Service
func (*Services) Deserialization ¶ added in v1.10.0
func (services *Services) Deserialization(source *common.ZeroCopySource) error
func (*Services) Serialization ¶ added in v1.10.0
func (services *Services) Serialization(sink *common.ZeroCopySink)
type SetAuthKeyParam ¶ added in v1.10.0
func (*SetAuthKeyParam) Deserialization ¶ added in v1.10.0
func (this *SetAuthKeyParam) Deserialization(source *common.ZeroCopySource) error
func (*SetAuthKeyParam) Serialization ¶ added in v1.10.0
func (this *SetAuthKeyParam) Serialization(sink *common.ZeroCopySink)
type SetKeyAccessParam ¶ added in v1.10.0
func (*SetKeyAccessParam) Deserialization ¶ added in v1.10.0
func (this *SetKeyAccessParam) Deserialization(source *common.ZeroCopySource) error
func (*SetKeyAccessParam) Serialization ¶ added in v1.10.0
func (this *SetKeyAccessParam) Serialization(sink *common.ZeroCopySink)