services

package
v0.0.0-...-d72c6c5 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2021 License: MIT Imports: 5 Imported by: 10

Documentation

Overview

Package services has the service models for storing the datastore service info

Index

Constants

View Source
const (
	//POSTGRES represents the postgres type of datastore service
	POSTGRES = "POSTGRES"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	gorm.Model
	//URL at which the service is available
	URL string
	//Port is the port at which the datastore service is available
	Port string
	//Username for authentication with the datastore service
	Username string
	//Password for authentication with the datastore service
	Password string
	//Name is the name of the datastore db
	Name string
	//Group to which the datastore belongs to classify the service
	Group string
	//Datasets has the number of datasets stored in the database
	Datasets int
	//DatastoreType indicates the type of datastore like postgres etc
	DatastoreType string
	//DataDirectory is the directory where the data is stored
	DataDirectory string
}

Service is defnition of the datastore service

func GetAll

func GetAll(conn *gorm.DB) ([]Service, error)

GetAll returns the list of datastore available

func (*Service) AddDataset

func (s *Service) AddDataset(conn *gorm.DB) error

AddDataset will add 1 to the datasets count of the service

func (*Service) Create

func (s *Service) Create(conn *gorm.DB) error

Create will create a given service

func (Service) Datastore

func (s Service) Datastore() (toolkit.Datastore, error)

Datastore returns the datastore associated with a service. It iwll return nil and boolean as false if the service doesn't represent a correct datastore

func (*Service) Delete

func (s *Service) Delete(conn *gorm.DB) error

Delete will delete a given service

func (*Service) Get

func (s *Service) Get(conn *gorm.DB) error

Get will set the info of the service for the give id from database

func (*Service) RemoveDataset

func (s *Service) RemoveDataset(conn *gorm.DB) error

RemoveDataset will remove 1 from the datasets count of the service

func (*Service) Update

func (s *Service) Update(conn *gorm.DB) error

Update will update a given service

func (Service) Validate

func (s Service) Validate() error

Validate validates whether the given service is valid or not

Jump to

Keyboard shortcuts

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