services

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogError

func LogError(err error, context ...map[string]interface{}) bool

LogError returns true on error

Types

type APIService

type APIService struct {
	HTTPServer    *http.Server
	HTTPTLSServer *http.Server
	// contains filtered or unexported fields
}

APIService the service handling the API

func NewAPIService

func NewAPIService(db *dbhelper.DBhelper, config *models.ConfigStruct, ownIP *string, callback models.SubscriberNotifyCallback) *APIService

NewAPIService create new API service

func (*APIService) Start

func (service *APIService) Start()

Start the API service

type CleanupService

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

CleanupService cleans up stuff

func NewCleanupService

func NewCleanupService(db *dbhelper.DBhelper, config *models.ConfigStruct) *CleanupService

NewCleanupService create a new cleanup service

func (CleanupService) Tick

func (service CleanupService) Tick() <-chan error

Tick runs the action of the service

type IPRefreshService

type IPRefreshService struct {
	IP string
	// contains filtered or unexported fields
}

IPRefreshService the service to keep the current IP validated

func NewIPRefreshService

func NewIPRefreshService(db *dbhelper.DBhelper) *IPRefreshService

NewIPRefreshService create a new IPRefreshService

func (*IPRefreshService) Init

func (service *IPRefreshService) Init() bool

Init inits the IPRefreshService. Return true on success

func (IPRefreshService) Tick

func (service IPRefreshService) Tick() <-chan bool

Tick runs the action of the service

type ResetUsageService

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

ResetUsageService the service to reset users traffic/hookCalls

func NewResetUsageService

func NewResetUsageService(db *dbhelper.DBhelper) *ResetUsageService

NewResetUsageService create new ResetUsageService

func (ResetUsageService) Tick

func (service ResetUsageService) Tick() <-chan error

Tick runs the action of the service

type RetryService

type RetryService struct {
	//RetryList list of retries
	RetryList map[uint32]*models.Retry

	//RetryTimes constant map of
	RetryTimes map[uint8]time.Duration

	Callback models.NotifyCallback
	// contains filtered or unexported fields
}

RetryService handles retries

func NewRetryService

func NewRetryService(db *dbhelper.DBhelper, conf *models.ConfigStruct) *RetryService

NewRetryService create new retryService

func (*RetryService) Add

func (retryService *RetryService) Add(db *dbhelper.DBhelper, subscriptionPK, sourcePK, WebhookPK uint32)

Add adds a subscription to the retryService

func (*RetryService) Remove

func (retryService *RetryService) Remove(db *dbhelper.DBhelper, subscriptionPK uint32, retry *models.Retry)

Remove removes a subscription from the retryService

func (*RetryService) Start

func (retryService *RetryService) Start()

Start starts the retryService

Jump to

Keyboard shortcuts

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