notebooks

package
v2.7.5 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: MIT Imports: 11 Imported by: 0

README

Notebooks

This package provides an HTTP API for interacting with InfluxDB notebooks. The HTTP handlers are located in the transport folder. The code for interacting with the sqlite datastore is located in the service.go file. Definitions for the basic types & interfaces associated with notebooks used throughout the platform are located in the top-level influxdb package, in the notebook.go file.

Anatomy

The backend representation of a notebook is very simple: An object with an ID, Name, associated organization ID, created/modified times, and a "spec". The "spec" is a mechanism for storing a JSON string defined entirely by the frontend UI. The notebook spec will likely be further defined in the future as the notebooks feature is developed and more sophisticated backend behaviors are required.

Use

Basic CRUD actions are available for interacting with notebooks through the API. Notebooks are persisted in the relational sqlite database, although they currently do not make use of any relational features. Again, it is likely that the more advanced features of the datastore will be utilized in the future as the notebooks feature evolves.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLoggingService

func NewLoggingService(logger *zap.Logger, underlying influxdb.NotebookService) *loggingService

func NewMetricCollectingService

func NewMetricCollectingService(reg prometheus.Registerer, underlying influxdb.NotebookService, opts ...metric.ClientOptFn) *metricsService

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(store *sqlite.SqlStore) *Service

func (*Service) CreateNotebook

func (s *Service) CreateNotebook(ctx context.Context, create *influxdb.NotebookReqBody) (*influxdb.Notebook, error)

CreateNotebook creates a notebook. Note that this and all "write" operations on the database need to use the Mutex lock, since sqlite can only handle 1 concurrent write operation at a time.

func (*Service) DeleteNotebook

func (s *Service) DeleteNotebook(ctx context.Context, id platform.ID) error

DeleteNotebook deletes a notebook.

func (*Service) GetNotebook

func (s *Service) GetNotebook(ctx context.Context, id platform.ID) (*influxdb.Notebook, error)

func (*Service) ListNotebooks

func (s *Service) ListNotebooks(ctx context.Context, filter influxdb.NotebookListFilter) ([]*influxdb.Notebook, error)

ListNotebooks lists notebooks matching the provided filter. Currently, only org_id is used in the filter. Future uses may support pagination via this filter as well.

func (*Service) UpdateNotebook

func (s *Service) UpdateNotebook(ctx context.Context, id platform.ID, update *influxdb.NotebookReqBody) (*influxdb.Notebook, error)

UpdateNotebook updates a notebook.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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