consensus

package
v0.18.8 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: MIT Imports: 14 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Data

func Data(c *gin.Context, code int, d any)

Types

type ConsBuilderFunc

type ConsBuilderFunc func(topic string, consTimeout time.Duration) (cons Consensus, err error)

type Consensus

type Consensus interface {
	Request(id string) bool
	Completed(id string)
}

type ConsensusBuilder

type ConsensusBuilder interface {
	AddTopic(topic string, consTimeout time.Duration) (cons Consensus, err error)
	Run()
}

func Init

func Init(port uint16, token string, discoverer discovery.Discoverer) (ConsensusBuilder, error)
type Consent struct {
	Id string
	Ip string
}

type ReqFunc

type ReqFunc func(id string) bool

type State

type State string
const (
	Invalid   State = "invalid"
	Requested State = "requested"
	Consented State = "consented"
	Completed State = "completed"
	Timedout  State = "timedout"
)

Jump to

Keyboard shortcuts

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