types

package
Version: v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APISuccessCode = "ok"
)

Variables

View Source
var (
	NoneLicense = License{Type: "none"}
)

Functions

This section is empty.

Types

type BaseResp added in v1.0.3

type BaseResp struct {
	Code string `json:"code,omitempty"`
	Msg  string `json:"msg,omitempty"`
}

func (*BaseResp) Success added in v1.0.3

func (resp *BaseResp) Success() bool

type BlockHashCheckReq

type BlockHashCheckReq struct {
	Hash   string `json:"hash,omitempty"`
	Height int64  `json:"height,omitempty"`
}

type BlockHashCheckResp

type BlockHashCheckResp struct {
	BaseResp
	Data bool `json:"data,omitempty"`
}

type BlockHashQueryResp

type BlockHashQueryResp struct {
	BaseResp
	Data BlockHashResp `json:"data,omitempty"`
}

type BlockHashResp

type BlockHashResp struct {
	LatestBlockHash   string `json:"latest_block_hash,omitempty"`
	LatestBlockHeight int64  `json:"latest_block_height,omitempty"`
	LatestBlockTime   string `json:"latest_block_time,omitempty"`
}

type License added in v1.0.3

type License struct {
	Params map[string]string `json:"parameters,omitempty"`
	Type   string            `json:"type,omitempty" binding:"required"`
}

type LicenseQueryResp

type LicenseQueryResp struct {
	BaseResp
	Data map[string]interface{} `json:"data,omitempty"`
	Tx   Transaction            `json:"tx,omitempty"`
}

type Metadata

type Metadata struct {
	ContentHash string `json:"content_hash,omitempty" binding:"required"`
	Created     string `json:"created,omitempty" binding:"required"`
	BlockHash   string `json:"block_hash,omitempty" binding:"required"`
	BlockHeight string `json:"block_height,omitempty"  binding:"required"`
	Language    string `json:"language,omitempty"  binding:"required"`
	Signature   string `json:"signature,omitempty" binding:"required"`
	PubKey      string `json:"pubkey,omitempty" binding:"required"`
	Type        string `json:"type,omitempty" binding:"required"`
	License     struct {
		Params map[string]string `json:"parameters,omitempty"`
		Type   string            `json:"type,omitempty" binding:"required"`
	} `json:"license,omitempty" binding:"required"`

	ID        string      `json:"id,omitempty"`
	Abstract  string      `json:"abstract,omitempty"`
	Category  string      `json:"category,omitempty"`
	Content   string      `json:"content,omitempty"`
	Data      interface{} `json:"data,omitempty"`
	DNA       string      `json:"dna,omitempty"`
	ParentDna string      `json:"parent_dna,omitempty"`
	Extra     interface{} `json:"extra,omitempty"`
	Source    string      `json:"source,omitempty"`
	Title     string      `json:"title,omitempty"`
}

func (*Metadata) Dumps

func (a *Metadata) Dumps() []byte

func (*Metadata) DumpsLicense

func (a *Metadata) DumpsLicense() []byte

func (*Metadata) DumpsRmSignSort

func (a *Metadata) DumpsRmSignSort() []byte

type MetadataQueryResp

type MetadataQueryResp struct {
	BaseResp
	Data Metadata    `json:"data,omitempty"`
	Tx   Transaction `json:"tx,omitempty"`
}

type MetadataSaveResp

type MetadataSaveResp struct {
	BaseResp
	Data struct {
		Dna string `json:"dna,omitempty" binding:"required"`
	} `json:"data,omitempty" binding:"required"`
}

type MetadataType

type MetadataType string
const (
	ARTICLE MetadataType = "article"
	IMAGE   MetadataType = "image"
	AUDIO   MetadataType = "audio"
	VIDEO   MetadataType = "video"
	PRIVATE MetadataType = "private"
	CUSTOM  MetadataType = "custom"
	FILE    MetadataType = "file"
)

func (MetadataType) Value

func (c MetadataType) Value() string

type RegisterAccountReq added in v1.0.3

type RegisterAccountReq struct {
	Signature string   `json:"signature"`
	Pubkey    string   `json:"pubkey"`
	Subkeys   []string `json:"subkeys"`
}

type RegisterAccountResp added in v1.0.3

type RegisterAccountResp struct {
	BaseResp
}

type Transaction

type Transaction struct {
	BlockHash   string `json:"block_hash,omitempty"`
	BlockHeight int64  `json:"block_height,omitempty"`
	DataHeight  int64  `json:"data_height,omitempty"`
	Sender      string `json:"sender,omitempty"`
	Time        int64  `json:"time,omitempty"`
}

func (*Transaction) Dumps

func (t *Transaction) Dumps() []byte

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL