Documentation
¶
Overview ¶
Package service encodes the business logic for dealing with data sources.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDataSourceService ¶
NewDataSourceService creates a new data source service.
Types ¶
type DataSourcesService ¶
type DataSourcesService interface {
// GetByName returns a data source by name.
GetByName(ctx context.Context, name string, project uuid.UUID, opts *ReadOptions) (*minderv1.DataSource, error)
// GetByID returns a data source by ID.
GetByID(ctx context.Context, id uuid.UUID, project uuid.UUID, opts *ReadOptions) (*minderv1.DataSource, error)
// List lists all data sources in the given project.
List(ctx context.Context, project uuid.UUID, opts *ReadOptions) ([]*minderv1.DataSource, error)
// Create creates a new data source.
Create(ctx context.Context, ds *minderv1.DataSource, opts *Options) (*minderv1.DataSource, error)
// Update updates an existing data source.
Update(ctx context.Context, ds *minderv1.DataSource, opts *Options) (*minderv1.DataSource, error)
// Delete deletes a data source in the given project.
//
// Note that one cannot delete a data source that is in use by a rule type.
Delete(ctx context.Context, id uuid.UUID, project uuid.UUID, opts *Options) error
// BuildDataSourceRegistry bundles up all data sources referenced in the rule type
// into a registry.
BuildDataSourceRegistry(ctx context.Context, rt *minderv1.RuleType, opts *Options) (*v1datasources.DataSourceRegistry, error)
}
DataSourcesService is an interface that defines the methods for the data sources service.
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options is a struct that contains the options for a service call
func OptionsBuilder ¶
func OptionsBuilder() *Options
OptionsBuilder is a function that returns a new Options struct
func (*Options) WithTransaction ¶
func (o *Options) WithTransaction(qtx db.ExtendQuerier) *Options
WithTransaction is a function that sets the transaction field in the Options struct
type ReadOptions ¶
type ReadOptions struct {
Options
// contains filtered or unexported fields
}
ReadOptions is a struct that contains the options for a read service call This extends the Options struct and adds a hierarchical field.
func ReadBuilder ¶
func ReadBuilder() *ReadOptions
ReadBuilder is a function that returns a new ReadOptions struct
func (*ReadOptions) Hierarchical ¶
func (o *ReadOptions) Hierarchical() *ReadOptions
Hierarchical allows the service to search in the project hierarchy
func (*ReadOptions) WithTransaction ¶
func (o *ReadOptions) WithTransaction(qtx db.ExtendQuerier) *ReadOptions
WithTransaction is a function that sets the transaction field in the Options struct
Directories
¶
| Path | Synopsis |
|---|---|
|
Package mock_service is a generated GoMock package.
|
Package mock_service is a generated GoMock package. |
|
fixtures
Package fixtures contains code for creating DataSourceService fixtures and is used in various parts of the code.
|
Package fixtures contains code for creating DataSourceService fixtures and is used in various parts of the code. |