service

package
v0.0.0-...-8a59038 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PortServer

type PortServer struct {
	proto.UnimplementedStorageServer

	PortStorage
}

PortServer is the server that provides operations on Port(s).

func NewPortServer

func NewPortServer(storage PortStorage) *PortServer

NewPortServer returns a new PortServer.

func (*PortServer) Load

func (server *PortServer) Load(_ *empty.Empty, stream proto.Storage_LoadServer) error

Load is a server-streaming RPC to return all available ports. TODO: - logging

func (*PortServer) Save

func (server *PortServer) Save(stream proto.Storage_SaveServer) error

Save is a server-streaming RPC to store ports to the repository.

type PortStorage

type PortStorage interface {
	Save(key string, port *proto.Port)
	Each(func(key string, port *proto.Port) error) error
}

PortStorage is a port repository providing basic data operation.

Jump to

Keyboard shortcuts

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