subscription

package
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package subscription implements user subscription.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Subscription

type Subscription struct {
	Cars   []string
	Active bool
	// contains filtered or unexported fields
}

Subscription represents user subscription to car search.

func New

func New(period time.Duration) *Subscription

New creates new clean Subscription.

func (*Subscription) CarExists

func (sub *Subscription) CarExists(ID string) bool

CarExists returns whatever car included in the list of cars for current subscription.

func (*Subscription) NewCars

func (sub *Subscription) NewCars(cars []string) []string

NewCars returns list of cars, which aren't in the list yet.

func (*Subscription) Start

func (sub *Subscription) Start(callback func())

Start initializes a new goroutine for current subscription with specified callback.

func (*Subscription) Stop

func (sub *Subscription) Stop()

Stop stops all running goroutines for current subscription.

Jump to

Keyboard shortcuts

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