service

package
v0.0.0-...-3629ecc Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2019 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultManifestKey = "consortiumManifest"
)

Variables

This section is empty.

Functions

func HttpServe

func HttpServe(service *Service, port int)

func NameHash

func NameHash(name string) common.Hash

Types

type ConsortiumManifest

type ConsortiumManifest struct {
	Quotum  string `json:"quotum"`
	Members []ConsortiumMember
	// contains filtered or unexported fields
}

type ConsortiumMember

type ConsortiumMember struct {
	EnsName string `json:"ensname"`
	Quotum  string `json:"quotum"`
}

type ENSClient

type ENSClient interface {
	Info(name string) (string, error)
	Text(name, key string) (string, error)
	SetText(name, key, text string) error
}

func NewENSClient

func NewENSClient(client *eth.Web3Client, address *common.Address) (ENSClient, error)

type ENSClientImpl

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

func (*ENSClientImpl) Info

func (e *ENSClientImpl) Info(name string) (string, error)

func (*ENSClientImpl) SetText

func (e *ENSClientImpl) SetText(name, key, text string) error

func (*ENSClientImpl) Text

func (e *ENSClientImpl) Text(name, key string) (string, error)

type IPFSClient

type IPFSClient interface {
	Cat(path string) (io.ReadCloser, error)
	Add(r io.Reader) (string, error)
	ObjectGet(path string) (*shell.IpfsObject, error)
	Pin(path string, recursive bool) error
	Unpin(path string) error
}

type Ipfsc

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

func NewIPFSCClient

func NewIPFSCClient(ipfs IPFSClient, ens ENSClient) *Ipfsc

func (*Ipfsc) ENS

func (i *Ipfsc) ENS() ENSClient

func (*Ipfsc) IPFS

func (i *Ipfsc) IPFS() IPFSClient

func (*Ipfsc) Read

func (i *Ipfsc) Read(ensname string) (interface{}, error)

func (*Ipfsc) WriteConsortiumManifest

func (i *Ipfsc) WriteConsortiumManifest(ensname string, manifest *ConsortiumManifest) error

func (*Ipfsc) WritePinningManifest

func (i *Ipfsc) WritePinningManifest(ensname string, manifest *PinningManifest) error

type PinningManifest

type PinningManifest struct {
	Quotum string   `json:"quotum"`
	Pin    []string `json:"pin"`
	// contains filtered or unexported fields
}

type ServerInfo

type ServerInfo struct {
	Current ServiceStats `json:"current"`
	Last    ServiceStats `json:"last"`
}

type Service

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

func NewService

func NewService(ipfsc *Ipfsc, storage *sto.Storage) *Service

func (*Service) Sync

func (s *Service) Sync(ensnames []string) (ServiceStats, error)

type ServiceStats

type ServiceStats struct {
	Count    int `json:"count"`
	Pinned   int `json:"pinned"`
	Unpinned int `json:"unpinned"`
	Errors   int `json:"errors"`
}

Jump to

Keyboard shortcuts

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