server

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

func NewService

func NewService(repo servers.Repository) *Service

func (*Service) Create

func (s *Service) Create(
	ctx context.Context,
	svr servers.Server,
	onConflict func(*servers.Server) bool,
) (servers.Server, error)

func (*Service) CreateOrUpdate

func (s *Service) CreateOrUpdate(
	ctx context.Context,
	svr servers.Server,
	onConflictDo func(*servers.Server),
) (servers.Server, error)

func (*Service) FilterRecent

func (s *Service) FilterRecent(
	ctx context.Context,
	recentness time.Duration,
	q query.Query,
	withStatus ds.DiscoveryStatus,
) ([]servers.Server, error)

func (*Service) Get

func (s *Service) Get(ctx context.Context, address addr.Addr) (servers.Server, error)

func (*Service) Update

func (s *Service) Update(
	ctx context.Context,
	svr servers.Server,
	onConflict func(*servers.Server) bool,
) (servers.Server, error)

Jump to

Keyboard shortcuts

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