admin

package
v0.0.0-...-e082e2d Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConditionAlreadyExists = errors.Errorf("condition already exists")
View Source
var ServerNotRunningError = errors.New("server not running")

Functions

This section is empty.

Types

type ConditionServer

type ConditionServer struct {
	api.UnimplementedConditionServiceServer
	// contains filtered or unexported fields
}

func NewConditionServer

func NewConditionServer(condRepo db.ConditionRepository, notifRepo db.NotificationRepository) *ConditionServer

func (*ConditionServer) AddCondition

func (c *ConditionServer) AddCondition(ctx context.Context, request *api.AddConditionRequest) (*api.ConditionResponse, error)

func (*ConditionServer) DeleteCondition

func (c *ConditionServer) DeleteCondition(ctx context.Context, request *api.GetConditionRequest) (*api.ConditionResponse, error)

func (*ConditionServer) GetCondition

func (c *ConditionServer) GetCondition(ctx context.Context, request *api.GetConditionRequest) (*api.ConditionResponse, error)

func (*ConditionServer) GetConditions

type OfferServer

type OfferServer struct {
	api.UnimplementedOfferServiceServer
	// contains filtered or unexported fields
}

func NewOfferServer

func NewOfferServer(repo db.OfferRepository) *OfferServer

func (*OfferServer) GetOffer

func (o *OfferServer) GetOffer(ctx context.Context, request *api.GetOfferRequest) (*api.OfferResponse, error)

func (*OfferServer) GetOffers

func (o *OfferServer) GetOffers(ctx context.Context, request *api.GetOffersRequest) (*api.OfferListResponse, error)

type ProcessorControl

type ProcessorControl interface {
	RunProcessing() error
	StopProcessing() error
	GetProcessingState() (ProcessorState, error)
}

type ProcessorServer

type ProcessorServer struct {
	api.UnimplementedProcessorServiceServer
	// contains filtered or unexported fields
}

func NewProcessorServer

func NewProcessorServer(control ProcessorControl) *ProcessorServer

func (*ProcessorServer) GetProcessingStatus

func (p *ProcessorServer) GetProcessingStatus(ctx context.Context, empty *emptypb.Empty) (*api.ProcessingStatus, error)

func (*ProcessorServer) StartProcessing

func (p *ProcessorServer) StartProcessing(ctx context.Context, empty *emptypb.Empty) (*emptypb.Empty, error)

func (*ProcessorServer) StopProcessing

func (p *ProcessorServer) StopProcessing(ctx context.Context, empty *emptypb.Empty) (*emptypb.Empty, error)

type ProcessorState

type ProcessorState struct {
	LastRun   time.Time
	NextRun   time.Time
	IsRunning bool
}

type Server

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

func NewServer

func NewServer(port int, ip string, db db.DB, control ProcessorControl) *Server

func (*Server) Close

func (s *Server) Close() error

func (*Server) Run

func (s *Server) Run() error

type WatchUrlServer

type WatchUrlServer struct {
	api.UnimplementedWatchUrlServiceServer
	// contains filtered or unexported fields
}

func NewWatchUrlServer

func NewWatchUrlServer(repo db.WatchUrlRepository) *WatchUrlServer

func (*WatchUrlServer) AddUrl

func (w *WatchUrlServer) AddUrl(ctx context.Context, request *api.AddUrlRequest) (*api.UrlResponse, error)

func (*WatchUrlServer) GetUrls

func (w *WatchUrlServer) GetUrls(ctx context.Context, request *api.GetUrlsRequest) (*api.UrlListResponse, error)

func (*WatchUrlServer) SetState

func (w *WatchUrlServer) SetState(ctx context.Context, request *api.SetStateRequest) (*api.UrlResponse, error)

Jump to

Keyboard shortcuts

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