Documentation ¶
Index ¶
- Variables
- func NewSource() sdk.Source
- func Specification() sdk.Specification
- type Source
- func (s *Source) Ack(ctx context.Context, position sdk.Position) error
- func (s *Source) Configure(ctx context.Context, cfg map[string]string) error
- func (s *Source) CreateRequestURL() string
- func (s *Source) Open(ctx context.Context, pos sdk.Position) error
- func (s *Source) Parameters() map[string]sdk.Parameter
- func (s *Source) Read(ctx context.Context) (sdk.Record, error)
- func (s *Source) Teardown(ctx context.Context) error
- type SourceConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var Connector = sdk.Connector{ NewSpecification: Specification, NewSource: NewSource, NewDestination: nil, }
Functions ¶
func Specification ¶
func Specification() sdk.Specification
Specification returns the connector's specification.
Types ¶
type Source ¶
type Source struct { sdk.UnimplementedSource // contains filtered or unexported fields }
func (*Source) CreateRequestURL ¶
type SourceConfig ¶
type SourceConfig struct { // url that contains the weather data URL string `json:"url" default:"https://api.openweathermap.org/data/2.5/weather"` // how often the connector will get data from the url PollingPeriod time.Duration `json:"pollingPeriod" default:"5m"` // city name to get the current weather for, ex: California, San Francisco, london. you can find the cities list // {city.list.json.gz} on http://bulk.openweathermap.org/sample/ City string `json:"city" default:"new york"` // your unique API key (you can always find it on your account page under https://home.openweathermap.org/api_keys) APPID string `json:"appid" validate:"required"` // units of measurement, for Fahrenheit use imperial, for Celsius use metric, for Kelvin use standard. Units string `json:"units" default:"imperial" validate:"inclusion=imperial|standard|metric"` }
func (SourceConfig) Parameters ¶
func (SourceConfig) Parameters() map[string]sdk.Parameter
Click to show internal directories.
Click to hide internal directories.