subscription

package
v0.0.23 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2019 License: MIT Imports: 0 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 `json:"cars"`
	Active bool     `json:"active"`
	// contains filtered or unexported fields
}

Subscription represents user subscription to car search.

func New

func New() *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(chan struct{}))

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