Documentation
¶
Index ¶
- Variables
- func DummyEmpty() interface{}
- type API
- type AddReq
- type AddResp
- type AddType
- type AddrInfo
- func (info *AddrInfo) AppendAddr(multiaddr ma.Multiaddr)
- func (info *AddrInfo) GetAddrs() (addrs []ma.Multiaddr)
- func (info AddrInfo) MarshalJSON() ([]byte, error)
- func (info *AddrInfo) SetDataStoreInfo(dataStoreInfo DataStoreInfo)
- func (info *AddrInfo) SetID(id string)
- func (info *AddrInfo) UnmarshalJSON(bytes []byte) error
- type AddrReq
- type AddrResp
- type Clique
- type Config
- type ConnectToReq
- type ConnectToResp
- type ContractInfo
- type ControllerService
- type DataHashEncoder
- type DataInfoV1
- type DataJSONer
- type DataRooter
- type DataStoreAPI
- type DataStoreInfo
- type DataStoreReq
- type DataStoreResp
- type Empty
- type Eth
- type GetReq
- type GetResp
- type IDReq
- type IDResp
- type Info
- type JSONer
- type Listener
- type LocalData
- type Marshaler
- type MediaInfo
- type Node
- type NodeAPI
- type NodeInfo
- type NodeLinkReq
- type NodeLinkResp
- type NodeListReq
- type NodeListResp
- type NodeManager
- type NodeType
- type NodeUnlinkReq
- type NodeUnlinkResp
- type PayReq
- type PayResp
- type PingReq
- type PingResp
- type Ports
- type Protocols
- type RecvCBFunc
- type RequestTag
- type SafeLocalData
- type Security
- type Serializable
- type Unmarshaler
- type UploadReq
- type UploadResp
- type Version
Constants ¶
This section is empty.
Variables ¶
View Source
var DataInfoVersion1, _ = ParseVersion("v0.0.1")
DataInfoVersion1 ...
Functions ¶
Types ¶
type API ¶
type API interface {
Ping(ctx context.Context, req *PingReq) (*PingResp, error)
ID(ctx context.Context, req *IDReq) (*IDResp, error)
Add(ctx context.Context, req *AddReq) (*AddResp, error)
NodeAPI() NodeAPI
DataStoreAPI() DataStoreAPI
}
API ...
type AddReq ¶
type AddReq struct {
//Setting options.UnixfsAddSettings
Type AddType
JSNFO string
Data []byte
Hash string
}
AddReq ...
type AddrInfo ¶
type AddrInfo struct {
ID string `json:"id"`
PublicKey string `json:"public_key"`
Addrs map[ma.Multiaddr]bool `json:"addrs"`
DataStore DataStoreInfo `json:"data_store"`
}
AddrInfo ...
func (*AddrInfo) AppendAddr ¶
AppendAddr ...
func (*AddrInfo) SetDataStoreInfo ¶
func (info *AddrInfo) SetDataStoreInfo(dataStoreInfo DataStoreInfo)
SetDataStoreInfo ...
func (*AddrInfo) UnmarshalJSON ¶
UnmarshalJSON ...
type Config ¶
type Config struct {
ByzantiumBlock int64 `json:"byzantiumBlock"`
ChainID int64 `json:"chainId"`
Clique Clique `json:"clique"`
ConstantinopleBlock int64 `json:"constantinopleBlock"`
Eip150Block int64 `json:"eip150Block"`
Eip150Hash string `json:"eip150Hash"`
Eip155Block int64 `json:"eip155Block"`
Eip158Block int64 `json:"eip158Block"`
HomesteadBlock int64 `json:"homesteadBlock"`
}
Config ...
type ContractInfo ¶
type ContractInfo struct {
Enode string `json:"enode"`
Enr string `json:"enr"`
ID string `json:"id"`
IP string `json:"ip"`
ListenAddr string `json:"listenAddr"`
Name string `json:"name"`
Ports Ports `json:"ports"`
Protocols Protocols `json:"protocols"`
}
ContractInfo ...
type ControllerService ¶
type ControllerService interface {
Start() error
Stop() error
Initialize() error
IsReady() bool
MessageHandle(func(s string))
}
ControllerService ...
type DataHashEncoder ¶
DataHashEncoder ...
type DataInfoV1 ¶
type DataInfoV1 struct {
RootHash string `xorm:"root_hash" json:"root_hash"` //源信息
MediaInfo MediaInfo `xorm:"media_info" json:"media_info"` //媒体信息
MediaURI string `xorm:"media_uri" json:"media_uri"` //入口地址
MediaHash string `xorm:"media_hash" json:"media_hash"` //入口HASH
MediaIndex string `xorm:"media_index" json:"media_index"` //入口名称
Info Info `xorm:"info" json:"info"` //补充信息
InfoURI string `xorm:"info_uri" json:"info_uri"` //补充信息地址
Security Security `xorm:"security" json:"security"` //安全验证
LastUpdate int64 `xorm:"last_update" json:"last_update"` //最后更新时间
Version Version `xorm:"version" json:"version"` //版本
}
DataInfoV1 ...
type DataStoreAPI ¶
type DataStoreAPI interface {
PinLs(ctx context.Context, req *DataStoreReq) (*DataStoreResp, error)
UploadFile(ctx context.Context, req *UploadReq) (*UploadResp, error)
}
DataStoreAPI ...
type DataStoreInfo ¶
type DataStoreInfo struct {
ID string `json:"ID"`
PublicKey string `json:"PublicKey"`
Addresses []string `json:"Addresses"`
AgentVersion string `json:"AgentVersion"`
ProtocolVersion string `json:"ProtocolVersion"`
}
DataStoreInfo ...
type Eth ¶
type Eth struct {
Config Config `json:"config"`
Difficulty int64 `json:"difficulty"`
Genesis string `json:"genesis"`
Head string `json:"head"`
Network int64 `json:"network"`
}
Eth ...
type IDResp ¶
type IDResp struct {
ID string
PublicKey string
Addrs []string
DataStore DataStoreInfo
}
IDResp ...
type Info ¶
type Info struct {
ThumbHash string `xorm:"thumb_hash" json:"thumb_hash"` //缩略图
ThumbURI string `xorm:"thumb_uri" json:"thumb_uri"` //缩略图
PosterHash string `xorm:"poster_hash" json:"poster_hash"` //海报地址
PosterURI string `xorm:"poster_uri" json:"poster_uri"` //缩略图
}
Info ...
type LocalData ¶
type LocalData struct {
Initialized bool
Node NodeInfo
Nodes map[string]NodeInfo //readonly or change by update
LDs map[string]uint8 //readonly or change by update:ipfs linked data
Addrs []string
LastUpdate int64
}
LocalData ...
type MediaInfo ¶
type MediaInfo struct {
No string `json:"no"` //编号
Intro string `json:"intro"` //简介
Alias []string `json:"alias"` //别名,片名
Role []string `json:"role"` //主演
Director string `json:"director"` //导演
Systematics string `json:"systematics"` //分级
Season string `json:"season"` //季
TotalEpisode string `json:"total_episode"` //总集数
Episode string `json:"episode"` //集数
Producer string `json:"producer"` //生产商
Publisher string `json:"publisher"` //发行商
Type string `json:"type"` //类型:film,FanDrama
Format string `json:"format"` //输出格式:3D,2D,VR(VR格式:Half-SBS:左右半宽,Half-OU:上下半高,SBS:左右全宽)
Language string `json:"language"` //语言
Caption string `json:"caption"` //字幕
Group string `json:"group"` //分组
Index string `json:"index"` //索引
Date string `json:"date"` //发行日期
Sharpness string `json:"sharpness"` //清晰度
Series string `json:"series"` //系列
Tags []string `json:"tags"` //标签
Length string `json:"length"` //时长
Sample []string `json:"sample"` //样板图
Uncensored bool `json:"uncensored"` //有码,无码
}
MediaInfo ...
type Node ¶
type Node interface {
ID() string
Ping() (string, error)
Addrs() []ma.Multiaddr
DataStoreInfo() (DataStoreInfo, error)
GetInfo() (NodeInfo, error)
Close() (err error)
IsClosed() bool
AppendAddr(addrs ...ma.Multiaddr)
SendClose()
Peers() ([]NodeInfo, error)
SendConnected() error
LDs() ([]string, error)
}
Node ...
type NodeAPI ¶
type NodeAPI interface {
Add(ctx context.Context, req *AddReq) (*AddResp, error)
Link(ctx context.Context, req *NodeLinkReq) (*NodeLinkResp, error)
Unlink(ctx context.Context, req *NodeUnlinkReq) (*NodeUnlinkResp, error)
List(ctx context.Context, req *NodeListReq) (*NodeListResp, error)
NodeAddrInfo(ctx context.Context, req *AddrReq) (*AddrResp, error)
}
NodeAPI ...
type NodeLinkReq ¶
NodeLinkReq ...
type NodeManager ¶
type NodeManager interface {
NodeAPI() NodeAPI
Local() SafeLocalData
Close()
Push(n Node)
Range(f func(key string, node Node) bool)
Conn(c net.Conn) (Node, error)
SaveNode() error
LoadNode() error
//RegisterLDRequest(func() ([]string, error))
RegisterAddrCallback(f func(info peer.AddrInfo) error)
ConnRemoteFromHash(hash string) error
}
NodeManager ...
type RequestTag ¶
type RequestTag int
RequestTag ...
const RequestTagLink RequestTag = iota
RequestTagLink ...
type SafeLocalData ¶
type SafeLocalData interface {
JSONer
JSON() string
Update(f func(data *LocalData))
Data() (data LocalData)
}
SafeLocalData ...
type Serializable ¶
type Serializable interface {
JSONer
DataRooter
DataHashEncoder
DataJSONer
}
Serializable ...
Click to show internal directories.
Click to hide internal directories.