api

package
v0.0.0-...-8220f0d Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Sbac       *sbac.ServiceSBAC
	Checkerclt *checkerclient.Client
	Sbacclt    sbacclient.Client
	ShardID    uint64
	NodeID     uint64
	Checker    checker.Service
	Top        *network.Topology
}

Config ...

type Controller

type Controller interface {
	AddTransaction(c *gin.Context)
	RegisterRoutes(router *gin.Engine)
}

Controller is the Key-Value controller

func New

func New(config *Config) Controller

New returns a new kv.Controller

type Dependency

type Dependency Trace

Dependency ...

type Error

type Error struct {
	Error string `json:"error"`
}

Error ...

type Object

type Object struct {
	Status    string      `json:"status"`
	Value     interface{} `json:"value"`
	VersionID string      `json:"versionId"`
}

Object ...

func BuildObjectResponse

func BuildObjectResponse(objects []*sbac.Object) (Object, error)

BuildObjectResponse ...

type ObjectIDResponse

type ObjectIDResponse struct {
	ID string `json:"id"`
}

ObjectIDResponse contains a full json graph

type ObjectRequest

type ObjectRequest struct {
	Object interface{} `json:"object"`
}

ObjectRequest contains a full json graph

type ObjectResponse

type ObjectResponse struct {
	Object interface{} `json:"object"`
}

ObjectResponse contains a full json graph

type OutputObject

type OutputObject struct {
	Labels []string `json:"labels"`
	Object string   `json:"object"`
}

type StateReport

type StateReport struct {
	CommitDecisions map[uint64]bool `json:"commitDecisions"`
	HashID          uint32          `json:"hashId"`
	PendingEvents   int32           `json:"pendingEvents"`
	Phase1Decisions map[uint64]bool `json:"phase1Decisions"`
	Phase2Decisions map[uint64]bool `json:"phase2Decisions"`
	State           string          `json:"state"`
}

StateReport ...

type StateReportResponse

type StateReportResponse struct {
	PendingEvents int32         `json:"pendingEvents"`
	States        []StateReport `json:"states"`
}

StateReportResponse ...

type Trace

type Trace struct {
	ContractID               string         `json:"contractId"`
	Dependencies             []Dependency   `json:"dependencies"`
	InputObjectVersionIDs    []string       `json:"inputObjectVersionIds"`
	InputReferenceVersionIDs []string       `json:"inputReferenceVersionIds"`
	OutputObjects            []OutputObject `json:"outputObjects"`
	Parameters               []string       `json:"parameters"`
	Procedure                string         `json:"procedure"`
	Returns                  []string       `json:"returns"`
}

Trace ...

func (*Trace) ToSBAC

func (tc *Trace) ToSBAC(mappings map[string]string) *sbac.Trace

ToSBAC ...

type Transaction

type Transaction struct {
	Mappings   map[string]string `json:"mappings"`
	Signatures map[uint64]string `json:"signatures"` //base64 encoded
	Traces     []Trace           `json:"traces"`
}

Transaction ...

func (*Transaction) ToSBAC

func (tx *Transaction) ToSBAC(validator TransactionValidator) (*sbac.Transaction, error)

ToSBAC ...

type TransactionValidator

type TransactionValidator interface {
	Validate(tx *Transaction) error
}

TransactionValidator ...

type Validator

type Validator struct{}

Validator ...

func (Validator) Validate

func (v Validator) Validate(tx *Transaction) error

Validate ...

func (Validator) ValidateTrace

func (v Validator) ValidateTrace(trace *Trace, mappings map[string]string) error

ValidateTrace ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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