p2p

package
v0.2.14 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: BSD-3-Clause Imports: 8 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command interface {
	Send(ctx context.Context, body map[string]interface{}) (response.Response, error)
	SendTo(ctx context.Context, cid cid.Cid, body map[string]interface{}) (response.Response, error)
}

type CommandService

type CommandService interface {
	Close()
}

type MatchDefinition

type MatchDefinition struct {
	Project     string
	Application string
	Protocol    string
	Command     string
}

func (*MatchDefinition) CachePrefix

func (m *MatchDefinition) CachePrefix() string

func (*MatchDefinition) String

func (m *MatchDefinition) String() string

type Service

type Service interface {
	components.ServiceComponent
	Stream(ctx context.Context, projectID, applicationID, protocol string) (Stream, error)
	StartStream(name, protocol string, handler StreamHandler) (CommandService, error)
	LookupService(matcher *MatchDefinition) (config *structureSpec.Service, application string, err error)
	Discover(ctx context.Context, max int, timeout time.Duration) ([]peer.AddrInfo, error)
}

type ServiceResource

type ServiceResource interface {
	Application() string
	Config() *structureSpec.Service
	Context() context.Context
	SmartOps(smartOps []string) (uint32, error)
	Type() uint32
}

type Serviceable

type Serviceable interface {
	components.FunctionServiceable
	Handle(data *command.Command) (time.Time, response.Response, error)
	Name() string
	Close()
}

type Stream

type Stream interface {
	Listen() (protocol string, err error)
	Command(command string) (Command, error)
	Close()
}

type StreamHandler

type StreamHandler func(cmd *command.Command) (resp response.Response, err error)

Jump to

Keyboard shortcuts

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