username

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package username is a generated protocol buffer package.

It is generated from these files:

x/nft/username/codec.proto

It has these top-level messages:

UsernameToken
TokenDetails
ChainAddress
IssueTokenMsg
AddChainAddressMsg
RemoveChainAddressMsg

Index

Constants

View Source
const (
	BucketName            = "usrnft"
	ChainAddressIndexName = "chainaddr"
)

Variables

View Source
var (
	ErrInvalidLengthCodec = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowCodec   = fmt.Errorf("proto: integer overflow")
)

Functions

func NewUsernameToken

func NewUsernameToken(key []byte, owner weave.Address, approvals []nft.ActionApprovals) *orm.SimpleObj

func RegisterQuery

func RegisterQuery(qr weave.QueryRouter)

RegisterQuery will register this bucket as "/nft/usernames"

func RegisterRoutes

func RegisterRoutes(r weave.Registry, auth x.Authenticator, issuer weave.Address)

RegisterRoutes will instantiate and register all handlers in this package

Types

type AddChainAddressHandler

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

func NewAddChainAddressHandler

func NewAddChainAddressHandler(auth x.Authenticator, issuer weave.Address, bucket Bucket, blockchains blockchain.Bucket) *AddChainAddressHandler

func (AddChainAddressHandler) Check

func (AddChainAddressHandler) Deliver

type AddChainAddressMsg

type AddChainAddressMsg struct {
	UsernameID   []byte `protobuf:"bytes,1,opt,name=username_id,json=usernameId,proto3" json:"username_id,omitempty"`
	BlockchainID []byte `protobuf:"bytes,2,opt,name=blockchain_id,json=blockchainId,proto3" json:"blockchain_id,omitempty"`
	Address      string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"`
}

func (*AddChainAddressMsg) Descriptor

func (*AddChainAddressMsg) Descriptor() ([]byte, []int)

func (*AddChainAddressMsg) GetAddress

func (m *AddChainAddressMsg) GetAddress() string

func (*AddChainAddressMsg) GetBlockchainID added in v0.10.0

func (m *AddChainAddressMsg) GetBlockchainID() []byte

func (*AddChainAddressMsg) GetUsernameID added in v0.10.0

func (m *AddChainAddressMsg) GetUsernameID() []byte

func (*AddChainAddressMsg) Marshal

func (m *AddChainAddressMsg) Marshal() (dAtA []byte, err error)

func (*AddChainAddressMsg) MarshalTo

func (m *AddChainAddressMsg) MarshalTo(dAtA []byte) (int, error)

func (*AddChainAddressMsg) Path

func (*AddChainAddressMsg) Path() string

Path returns the routing path for this message

func (*AddChainAddressMsg) ProtoMessage

func (*AddChainAddressMsg) ProtoMessage()

func (*AddChainAddressMsg) Reset

func (m *AddChainAddressMsg) Reset()

func (*AddChainAddressMsg) Size

func (m *AddChainAddressMsg) Size() (n int)

func (*AddChainAddressMsg) String

func (m *AddChainAddressMsg) String() string

func (*AddChainAddressMsg) Unmarshal

func (m *AddChainAddressMsg) Unmarshal(dAtA []byte) error

func (*AddChainAddressMsg) Validate

func (m *AddChainAddressMsg) Validate() error

type Bucket

type Bucket struct {
	orm.Bucket
}

func NewBucket

func NewBucket() Bucket

func (Bucket) Create

func (b Bucket) Create(db weave.KVStore, owner weave.Address, id []byte, approvals []nft.ActionApprovals, addresses []ChainAddress) (orm.Object, error)

type ChainAddress

type ChainAddress struct {
	// blockchainID is the reference to a blockchain nft token.
	BlockchainID []byte `protobuf:"bytes,1,opt,name=blockchain_id,json=blockchainId,proto3" json:"blockchain_id,omitempty"`
	// address is the unique identifier of an account on the referenced blockchain
	Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
}

ChainAddress is an address on a blockchain

func (*ChainAddress) Descriptor

func (*ChainAddress) Descriptor() ([]byte, []int)

func (ChainAddress) Equals

func (p ChainAddress) Equals(o ChainAddress) bool

func (*ChainAddress) GetAddress

func (m *ChainAddress) GetAddress() string

func (*ChainAddress) GetBlockchainID added in v0.10.0

func (m *ChainAddress) GetBlockchainID() []byte

func (*ChainAddress) Marshal

func (m *ChainAddress) Marshal() (dAtA []byte, err error)

func (*ChainAddress) MarshalTo

func (m *ChainAddress) MarshalTo(dAtA []byte) (int, error)

func (*ChainAddress) ProtoMessage

func (*ChainAddress) ProtoMessage()

func (*ChainAddress) Reset

func (m *ChainAddress) Reset()

func (*ChainAddress) Size

func (m *ChainAddress) Size() (n int)

func (*ChainAddress) String

func (m *ChainAddress) String() string

func (*ChainAddress) Unmarshal

func (m *ChainAddress) Unmarshal(dAtA []byte) error

func (*ChainAddress) Validate

func (p *ChainAddress) Validate() error

type IssueHandler

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

func NewIssueHandler

func NewIssueHandler(auth x.Authenticator, issuer weave.Address, bucket Bucket, blockchains blockchain.Bucket) *IssueHandler

func (IssueHandler) Check

func (h IssueHandler) Check(ctx weave.Context, store weave.KVStore, tx weave.Tx) (weave.CheckResult, error)

func (IssueHandler) Deliver

func (h IssueHandler) Deliver(ctx weave.Context, store weave.KVStore, tx weave.Tx) (weave.DeliverResult, error)

type IssueTokenMsg

type IssueTokenMsg struct {
	ID        []byte                `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Owner     []byte                `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"`
	Approvals []nft.ActionApprovals `protobuf:"bytes,3,rep,name=approvals" json:"approvals"`
	Details   TokenDetails          `protobuf:"bytes,4,opt,name=details" json:"details"`
}

func (*IssueTokenMsg) Descriptor

func (*IssueTokenMsg) Descriptor() ([]byte, []int)

func (*IssueTokenMsg) GetApprovals

func (m *IssueTokenMsg) GetApprovals() []nft.ActionApprovals

func (*IssueTokenMsg) GetDetails

func (m *IssueTokenMsg) GetDetails() TokenDetails

func (*IssueTokenMsg) GetID added in v0.10.0

func (m *IssueTokenMsg) GetID() []byte

func (*IssueTokenMsg) GetOwner

func (m *IssueTokenMsg) GetOwner() []byte

func (*IssueTokenMsg) Marshal

func (m *IssueTokenMsg) Marshal() (dAtA []byte, err error)

func (*IssueTokenMsg) MarshalTo

func (m *IssueTokenMsg) MarshalTo(dAtA []byte) (int, error)

func (*IssueTokenMsg) Path

func (*IssueTokenMsg) Path() string

Path returns the routing path for this message

func (*IssueTokenMsg) ProtoMessage

func (*IssueTokenMsg) ProtoMessage()

func (*IssueTokenMsg) Reset

func (m *IssueTokenMsg) Reset()

func (*IssueTokenMsg) Size

func (m *IssueTokenMsg) Size() (n int)

func (*IssueTokenMsg) String

func (m *IssueTokenMsg) String() string

func (*IssueTokenMsg) Unmarshal

func (m *IssueTokenMsg) Unmarshal(dAtA []byte) error

func (*IssueTokenMsg) Validate

func (m *IssueTokenMsg) Validate() error

type RemoveChainAddressHandler

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

func NewRemoveChainAddressHandler

func NewRemoveChainAddressHandler(auth x.Authenticator, issuer weave.Address, bucket Bucket) *RemoveChainAddressHandler

func (RemoveChainAddressHandler) Check

func (RemoveChainAddressHandler) Deliver

type RemoveChainAddressMsg

type RemoveChainAddressMsg struct {
	UsernameID   []byte `protobuf:"bytes,1,opt,name=username_id,json=usernameId,proto3" json:"username_id,omitempty"`
	BlockchainID []byte `protobuf:"bytes,2,opt,name=blockchain_id,json=blockchainId,proto3" json:"blockchain_id,omitempty"`
	Address      string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"`
}

func (*RemoveChainAddressMsg) Descriptor

func (*RemoveChainAddressMsg) Descriptor() ([]byte, []int)

func (*RemoveChainAddressMsg) GetAddress

func (m *RemoveChainAddressMsg) GetAddress() string

func (*RemoveChainAddressMsg) GetBlockchainID added in v0.10.0

func (m *RemoveChainAddressMsg) GetBlockchainID() []byte

func (*RemoveChainAddressMsg) GetUsernameID added in v0.10.0

func (m *RemoveChainAddressMsg) GetUsernameID() []byte

func (*RemoveChainAddressMsg) Marshal

func (m *RemoveChainAddressMsg) Marshal() (dAtA []byte, err error)

func (*RemoveChainAddressMsg) MarshalTo

func (m *RemoveChainAddressMsg) MarshalTo(dAtA []byte) (int, error)

func (*RemoveChainAddressMsg) Path

func (*RemoveChainAddressMsg) Path() string

Path returns the routing path for this message

func (*RemoveChainAddressMsg) ProtoMessage

func (*RemoveChainAddressMsg) ProtoMessage()

func (*RemoveChainAddressMsg) Reset

func (m *RemoveChainAddressMsg) Reset()

func (*RemoveChainAddressMsg) Size

func (m *RemoveChainAddressMsg) Size() (n int)

func (*RemoveChainAddressMsg) String

func (m *RemoveChainAddressMsg) String() string

func (*RemoveChainAddressMsg) Unmarshal

func (m *RemoveChainAddressMsg) Unmarshal(dAtA []byte) error

func (*RemoveChainAddressMsg) Validate

func (m *RemoveChainAddressMsg) Validate() error

type Token

type Token interface {
	nft.BaseNFT
	GetChainAddresses() []ChainAddress
	SetChainAddresses(actor weave.Address, newKeys []ChainAddress) error
}

func AsUsername

func AsUsername(obj orm.Object) (Token, error)

AsUsername will safely type-cast any value from Bucket

type TokenDetails

type TokenDetails struct {
	Addresses []ChainAddress `protobuf:"bytes,1,rep,name=addresses" json:"addresses"`
}

func (*TokenDetails) Clone

func (t *TokenDetails) Clone() *TokenDetails

func (*TokenDetails) Descriptor

func (*TokenDetails) Descriptor() ([]byte, []int)

func (*TokenDetails) GetAddresses

func (m *TokenDetails) GetAddresses() []ChainAddress

func (*TokenDetails) Marshal

func (m *TokenDetails) Marshal() (dAtA []byte, err error)

func (*TokenDetails) MarshalTo

func (m *TokenDetails) MarshalTo(dAtA []byte) (int, error)

func (*TokenDetails) ProtoMessage

func (*TokenDetails) ProtoMessage()

func (*TokenDetails) Reset

func (m *TokenDetails) Reset()

func (*TokenDetails) Size

func (m *TokenDetails) Size() (n int)

func (*TokenDetails) String

func (m *TokenDetails) String() string

func (*TokenDetails) Unmarshal

func (m *TokenDetails) Unmarshal(dAtA []byte) error

func (*TokenDetails) Validate

func (t *TokenDetails) Validate() error

type UsernameToken

type UsernameToken struct {
	Base    *nft.NonFungibleToken `protobuf:"bytes,1,opt,name=base" json:"base,omitempty"`
	Details *TokenDetails         `protobuf:"bytes,2,opt,name=details" json:"details,omitempty"`
}

func (*UsernameToken) Approvals

func (u *UsernameToken) Approvals() *nft.ApprovalOps

func (*UsernameToken) Copy

func (u *UsernameToken) Copy() orm.CloneableData

func (*UsernameToken) Descriptor

func (*UsernameToken) Descriptor() ([]byte, []int)

func (*UsernameToken) GetBase

func (m *UsernameToken) GetBase() *nft.NonFungibleToken

func (*UsernameToken) GetChainAddresses

func (u *UsernameToken) GetChainAddresses() []ChainAddress

func (*UsernameToken) GetDetails

func (m *UsernameToken) GetDetails() *TokenDetails

func (*UsernameToken) Marshal

func (m *UsernameToken) Marshal() (dAtA []byte, err error)

func (*UsernameToken) MarshalTo

func (m *UsernameToken) MarshalTo(dAtA []byte) (int, error)

func (*UsernameToken) OwnerAddress

func (u *UsernameToken) OwnerAddress() weave.Address

func (*UsernameToken) ProtoMessage

func (*UsernameToken) ProtoMessage()

func (*UsernameToken) Reset

func (m *UsernameToken) Reset()

func (*UsernameToken) SetApprovals added in v0.9.1

func (m *UsernameToken) SetApprovals(a nft.Approvals)

func (*UsernameToken) SetChainAddresses

func (u *UsernameToken) SetChainAddresses(actor weave.Address, newAddresses []ChainAddress) error

func (*UsernameToken) Size

func (m *UsernameToken) Size() (n int)

func (*UsernameToken) String

func (m *UsernameToken) String() string

func (*UsernameToken) Transfer

func (u *UsernameToken) Transfer(newOwner weave.Address) error

func (*UsernameToken) Unmarshal

func (m *UsernameToken) Unmarshal(dAtA []byte) error

func (*UsernameToken) Validate

func (u *UsernameToken) Validate() error

Jump to

Keyboard shortcuts

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