p2p

package
v0.2.0-beta Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2020 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func AttachAPI

func AttachAPI(sat *satellite.Satellite, router *mux.Router, manager *RatingManager) *mux.Router

func Bootstrap

func Bootstrap(cdae *configs.Daemon, csat *config.Satellite, ratingManager *RatingManager, killsig chan int)

Types

type Rating

type Rating struct {
	Type          string             `json:"type"`
	Source        string             `json:"src"`
	SourcePK      models.Pubkeys     `json:"srcpk"`
	Destination   string             `json:"dst"`
	DestinationPK models.Pubkeys     `json:"dstpk"`
	Signatures    []models.Signature `json:"sig"`
	Content       interface{}        `json:"rating"`
}

func BuyerRatingFromContract

func BuyerRatingFromContract(contract *models.Contract) (rating *Rating, err error)

func VendorRatingFromContract

func VendorRatingFromContract(contract *models.Contract) (rating *Rating, err error)

type RatingManager

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

func InitializeRatingManager

func InitializeRatingManager(path string) (man *RatingManager, err error)

func (*RatingManager) Close

func (rm *RatingManager) Close() error

func (*RatingManager) IngestCompletionRating

func (rm *RatingManager) IngestCompletionRating(contract *models.Contract) (rating *Rating, err error)

func (*RatingManager) IngestFulfillmentRating

func (rm *RatingManager) IngestFulfillmentRating(contract *models.Contract) (rating *Rating, err error)

func (*RatingManager) InsertRating

func (rm *RatingManager) InsertRating(rating *Rating) (err error)

type RatingRequest

type RatingRequest struct {
	Identity string `json:"ident"`
}

type WriteRequest

type WriteRequest struct {
	PacketType  string      `json:"type"`
	Destination string      `json:"destination"`
	Namespace   string      `json:"namespace"`
	Content     interface{} `json:"content"`
}

Jump to

Keyboard shortcuts

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