database

package
v0.0.0-...-89ebdc0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2022 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SundsvallAnlaggningPrefix string = "se:sundsvall:facilities:"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Datastore

type Datastore interface {
	GetBeachFromID(id string) (*domain.Beach, error)
	GetAllBeaches() ([]domain.Beach, error)
	UpdateWaterTemperatureFromDeviceID(device string, temp float64, observedAt time.Time) (string, error)

	GetTrailFromID(id string) (*domain.ExerciseTrail, error)
	GetAllTrails() ([]domain.ExerciseTrail, error)
	SetTrailOpenStatus(trailID string, isOpen bool) error
	UpdateTrailLastPreparationTime(trailID string, dateLastPreparation time.Time) error
}

Datastore is an interface that abstracts away the database implementation

func NewDatabaseConnection

func NewDatabaseConnection(sourceURL, apiKey string, logger zerolog.Logger) (Datastore, error)

NewDatabaseConnection does not open a new connection ...

type Feature

type Feature struct {
	ID         int64        `json:"id"`
	Properties FeatureProps `json:"properties"`
	Geometry   FeatureGeom  `json:"geometry"`
}

type FeatureCollection

type FeatureCollection struct {
	Type     string    `json:"type"`
	Features []Feature `json:"features"`
}

type FeatureGeom

type FeatureGeom struct {
	Type        string          `json:"type"`
	Coordinates json.RawMessage `json:"coordinates"`
}

type FeaturePropField

type FeaturePropField struct {
	ID    int64           `json:"id"`
	Value json.RawMessage `json:"value"`
}

type FeatureProps

type FeatureProps struct {
	Name      string          `json:"name"`
	Type      string          `json:"type"`
	Published bool            `json:"published"`
	Fields    json.RawMessage `json:"fields"`
	Created   *string         `json:"created,omitempty"`
	Updated   *string         `json:"updated,omitempty"`
}

Jump to

Keyboard shortcuts

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