metadata

package
v0.0.0-...-da31739 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2018 License: LGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContentMetaToJSON

func ContentMetaToJSON(meta ContentMetadata) (string, error)

ContentMetaToJSON serialize content metadata to json string

Types

type ContentMetadata

type ContentMetadata struct {
	Hash  string `json:"hash,required"`
	Date  int64  `json:"date,required"`
	Owner string `json:"owner,required"`
}

ContentMetadata represents metadata of a content

func ContentMetaFromJSON

func ContentMetaFromJSON(metaString string) (meta ContentMetadata, err error)

ContentMetaFromJSON deserialize content metadata from json string

type DBRedis

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

DBRedis is a Redis storage implementation of store interface

func NewDBRedis

func NewDBRedis(url *string) (*DBRedis, error)

NewDBRedis create a new DBRedis instance and connect to it. Pass nil as url to connect to local redis server running on default.

func (*DBRedis) Get

func (db *DBRedis) Get(hash string) (v interface{}, err error)

Get metadata by hash key

func (*DBRedis) Save

func (db *DBRedis) Save(hash string, data interface{}) (err error)

Save metadata to the hash key

type SkillMetadata

type SkillMetadata struct {
	Hash      string `json:"hash,required"`
	Date      int64  `json:"date,required"`
	Price     uint32 `json:"price,required"`
	Publisher string `json:"publisher,required"`
	Platform  string `json:"platform,required"`
	Consumer  string `json:"consumer,required"`
}

SkillMetadata represents metadata of a skill contract

type Store

type Store interface {
	Get(hash string) (interface{}, error)
	Save(hash string, data interface{}) error
}

Store is a interface to save or retrieve metadat

Jump to

Keyboard shortcuts

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