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.
Index ¶
- type Library
- func (myLibrary *Library) Close()
- func (myLibrary *Library) Connect(ctx context.Context) error
- func (myLibrary *Library) LastUpdated(ctx context.Context) (time.Time, error)
- func (myLibrary *Library) NumSubscriptions(ctx context.Context) (int, error)
- func (myLibrary *Library) SaveDB(ctx context.Context) error
- func (myLibrary *Library) SaveObservations(queue <-chan *data.Observation, wg *sync.WaitGroup)
- func (myLibrary *Library) SubscriptionFromID(ctx context.Context, id string) (*Subscription, error)
- func (myLibrary *Library) Subscriptions(ctx context.Context) ([]*Subscription, error)
- func (myLibrary *Library) Summary(ctx context.Context) (string, error)
- func (myLibrary *Library) TotalRecords(ctx context.Context) (int, error)
- func (myLibrary *Library) TotalSecurities(ctx context.Context) (int, error)
- type Subscription
- func (subscription *Subscription) Activate(ctx context.Context) error
- func (subscription *Subscription) ComputeTableNames()
- func (subscription *Subscription) Deactivate(ctx context.Context) error
- func (subscription *Subscription) Delete(ctx context.Context) error
- func (subscription *Subscription) ManagePartitions(ctx context.Context) error
- func (subscription *Subscription) PartitionTables() []string
- func (subscription *Subscription) Save(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Library ¶
func (*Library) LastUpdated ¶
LastUpdated returns the date that the database was last updated
func (*Library) NumSubscriptions ¶
NumSubscriptions returns the total count of subscriptions configured in the database
func (*Library) SaveObservations ¶
func (myLibrary *Library) SaveObservations(queue <-chan *data.Observation, wg *sync.WaitGroup)
SaveObservations continuously reads from the input queue
func (*Library) SubscriptionFromID ¶
SubscriptionFromID fetches a subscription from the library with the given ID
func (*Library) Subscriptions ¶
func (myLibrary *Library) Subscriptions(ctx context.Context) ([]*Subscription, error)
Subscriptions returns an array of subscription objects
func (*Library) TotalRecords ¶
TotalRecords returns the total number of records in the library
type Subscription ¶
type Subscription struct { ID uuid.UUID Name string Provider string Dataset string Config map[string]string DataTables []string DataTypes []string DataTablesMap map[string]string IsPartitioned bool TotalRecords int64 NumRecordsLastImport int64 TotalSecurities int64 NumSecuritiesLastImport int64 FirstObsDate time.Time LastObsDate time.Time Schedule string HealthCheckID string LastRun time.Time Active bool SchemaVersion int CreatedOn time.Time CreatedBy string Library *Library }
func (*Subscription) Activate ¶
func (subscription *Subscription) Activate(ctx context.Context) error
Activate the subscription
func (*Subscription) ComputeTableNames ¶
func (subscription *Subscription) ComputeTableNames()
Compute table names based on subscription data types
func (*Subscription) Deactivate ¶
func (subscription *Subscription) Deactivate(ctx context.Context) error
Deactivate the subscription; all data is still saved in the database but the subscription is marked as inactive and it won't show up in reports
func (*Subscription) Delete ¶
func (subscription *Subscription) Delete(ctx context.Context) error
Delete the subscription from database along with all associated tables
func (*Subscription) ManagePartitions ¶
func (subscription *Subscription) ManagePartitions(ctx context.Context) error
ManagePartitions creates any new partitions needed for the subscription
func (*Subscription) PartitionTables ¶
func (subscription *Subscription) PartitionTables() []string
PartitionTables returns the table names for all paritions in the set