burrow: github.com/hyperledger/burrow/execution/names Index | Files

package names

import "github.com/hyperledger/burrow/execution/names"

Index

Package Files

cache.go names.go names.pb.go

Constants

const (

    // cost for storing a name for a block is
    // CostPerBlock*CostPerByte*(len(data) + 32)
    NameByteCostMultiplier  uint64 = 1
    NameBlockCostMultiplier uint64 = 1

    MaxNameLength = 64
    MaxDataLength = 1 << 16
)

Variables

var (
    ErrInvalidLengthNames        = fmt.Errorf("proto: negative length found during unmarshaling")
    ErrIntOverflowNames          = fmt.Errorf("proto: integer overflow")
    ErrUnexpectedEndOfGroupNames = fmt.Errorf("proto: unexpected end of group")
)
var MinNameRegistrationPeriod uint64 = 5

func NameBaseCost Uses

func NameBaseCost(name, data string) uint64

base cost is "effective" number of bytes

func NameCostForExpiryIn Uses

func NameCostForExpiryIn(name, data string, expiresIn uint64) uint64

func NameCostPerBlock Uses

func NameCostPerBlock(baseCost uint64) uint64

type Cache Uses

type Cache struct {
    sync.RWMutex
    // contains filtered or unexported fields
}

The Cache helps prevent unnecessary IAVLTree updates and garbage generation.

func NewCache Uses

func NewCache(backend Reader) *Cache

Returns a Cache that wraps an underlying NameRegCacheGetter to use on a cache miss, can write to an output Writer via Sync. Not goroutine safe, use syncStateCache if you need concurrent access

func (*Cache) Backend Uses

func (cache *Cache) Backend() Reader

func (*Cache) GetName Uses

func (cache *Cache) GetName(name string) (*Entry, error)

func (*Cache) RemoveName Uses

func (cache *Cache) RemoveName(name string) error

func (*Cache) Reset Uses

func (cache *Cache) Reset(backend Reader)

Resets the cache to empty initialising the backing map to the same size as the previous iteration

func (*Cache) Sync Uses

func (cache *Cache) Sync(state Writer) error

Writes whatever is in the cache to the output Writer state. Does not flush the cache, to do that call Reset() after Sync or use Flush if your wish to use the output state as your next backend

func (*Cache) UpdateName Uses

func (cache *Cache) UpdateName(entry *Entry) error

type Entry Uses

type Entry struct {
    // registered name for the entry
    Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"`
    // address that created the entry
    Owner github_com_hyperledger_burrow_crypto.Address `protobuf:"bytes,2,opt,name=Owner,proto3,customtype=github.com/hyperledger/burrow/crypto.Address" json:"Owner"`
    // data to store under this name
    Data string `protobuf:"bytes,3,opt,name=Data,proto3" json:"Data,omitempty"`
    // block at which this entry expires
    Expires              uint64   `protobuf:"varint,4,opt,name=Expires,proto3" json:"Expires,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

NameReg provides a global key value store based on Name, Data pairs that are subject to expiry and ownership by an account.

func (*Entry) Descriptor Uses

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

func (*Entry) Get Uses

func (e *Entry) Get(key string) (value interface{}, ok bool)

func (*Entry) GetData Uses

func (m *Entry) GetData() string

func (*Entry) GetExpires Uses

func (m *Entry) GetExpires() uint64

func (*Entry) GetName Uses

func (m *Entry) GetName() string

func (*Entry) Marshal Uses

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

func (*Entry) MarshalTo Uses

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

func (*Entry) MarshalToSizedBuffer Uses

func (m *Entry) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Entry) ProtoMessage Uses

func (*Entry) ProtoMessage()

func (*Entry) Reset Uses

func (m *Entry) Reset()

func (*Entry) Size Uses

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

func (*Entry) String Uses

func (e *Entry) String() string

func (*Entry) Unmarshal Uses

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

func (*Entry) XXX_DiscardUnknown Uses

func (m *Entry) XXX_DiscardUnknown()

func (*Entry) XXX_Marshal Uses

func (m *Entry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Entry) XXX_Merge Uses

func (m *Entry) XXX_Merge(src proto.Message)

func (*Entry) XXX_MessageName Uses

func (*Entry) XXX_MessageName() string

func (*Entry) XXX_Size Uses

func (m *Entry) XXX_Size() int

func (*Entry) XXX_Unmarshal Uses

func (m *Entry) XXX_Unmarshal(b []byte) error

type Iterable Uses

type Iterable interface {
    IterateNames(consumer func(*Entry) error) (err error)
}

type IterableReader Uses

type IterableReader interface {
    Iterable
    Reader
}

type IterableReaderWriter Uses

type IterableReaderWriter interface {
    Iterable
    ReaderWriter
}

type Reader Uses

type Reader interface {
    GetName(name string) (*Entry, error)
}

type ReaderWriter Uses

type ReaderWriter interface {
    Reader
    Writer
}

type Writer Uses

type Writer interface {
    // Updates the name entry creating it if it does not exist
    UpdateName(entry *Entry) error
    // Remove the name entry
    RemoveName(name string) error
}

Package names imports 12 packages (graph) and is imported by 44 packages. Updated 2020-04-30. Refresh now. Tools for package owners.