provider

package
v0.0.0-...-53cb395 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Copyright 2024 SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2024 SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrProviderNotFound = errors.New("provider not found")
	ErrDatasetNotFound  = errors.New("dataset not found")
)
View Source
var (
	ErrInvalidStatusCode = errors.New("invalid status code received")
)
View Source
var Map = map[string]Provider{
	"polygon": &Polygon{},
}

Functions

func NewSubscription

func NewSubscription(providerName, datasetName string, config map[string]string, myLibrary *library.Library) (*library.Subscription, error)

NewSubscription returns a new subscription object with the dataset properly filled out

Types

type Dataset

type Dataset struct {
	Name        string
	Description string
	DataTypes   []*data.DataType
	DateRange   func() (time.Time, time.Time)

	// Fetch is called when pvdata wants to retrieve measurements from the dataset. It
	// passes a config with the provider configuration, a channel to write results to,
	// a logger to write log messages to, and a channel to write progress.
	Fetch func(context.Context, *library.Subscription, chan<- *data.Observation, chan<- data.RunSummary)
}

type Polygon

type Polygon struct {
}

func (*Polygon) ConfigDescription

func (polygon *Polygon) ConfigDescription() map[string]string

func (*Polygon) Datasets

func (polygon *Polygon) Datasets() map[string]Dataset

func (*Polygon) Description

func (polygon *Polygon) Description() string

func (*Polygon) Name

func (polygon *Polygon) Name() string

type Provider

type Provider interface {
	Name() string
	ConfigDescription() map[string]string
	Description() string
	Datasets() map[string]Dataset
}

Jump to

Keyboard shortcuts

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