data_source

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: Apache-2.0 Imports: 5 Imported by: 9

Documentation

Overview

Package data_source provides the tooling to build the Raito data source import file. Simply use the NewDataSourceFileCreator function by passing in the config coming from the CLI to create the necessary file(s). The returned DataSourceFileCreator can then be used (using the AddDataObjects function) to write DataObjects to the file. Make sure to call the Close function on the creator at the end (tip: use defer).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataObject

type DataObject struct {
	ExternalId           string                 `json:"externalId"`
	Name                 string                 `json:"name"`
	FullName             string                 `json:"fullName"`
	Type                 string                 `json:"type"`
	Description          string                 `json:"description"`
	ParentExternalId     string                 `json:"parentExternalId"`
	Tags                 map[string]interface{} `json:"tags"`
	AvailablePermissions []string               `json:"availablePermissions"`
}

DataObject represents a data object in the format that is suitable to be imported into a Raito data source.

type DataObjectReference added in v0.6.0

type DataObjectReference struct {
	FullName string `json:"fullName"`
	Type     string `json:"type"`
}

DataObjectReference represents the reference to a DataObject suitable for e.g. defining the What in Access Provider import

type DataSourceDetails added in v0.12.0

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

To handle availablePermissions on Data Source level correctly, we need to import a DataObject of type datasource. DataSourceDetails is a helper to abstract this from the plugin and just expose some setters. The import file creator then automatically prepends the import file with this DataObject

func (*DataSourceDetails) AddAvailablePermission added in v0.12.0

func (d *DataSourceDetails) AddAvailablePermission(permission string)

func (*DataSourceDetails) SetAvailablePermissions added in v0.12.0

func (d *DataSourceDetails) SetAvailablePermissions(permissions []string)

func (*DataSourceDetails) SetDescription added in v0.12.0

func (d *DataSourceDetails) SetDescription(desc string)

func (*DataSourceDetails) SetFullname added in v0.12.0

func (d *DataSourceDetails) SetFullname(name string)

func (*DataSourceDetails) SetName added in v0.12.0

func (d *DataSourceDetails) SetName(name string)

type DataSourceFileCreator

type DataSourceFileCreator interface {
	AddDataObjects(dataObjects []DataObject) error
	Close()
	GetDataObjectCount() int
	GetDataSourceDetails() *DataSourceDetails
}

DataSourceFileCreator describes the interface for easily creating the data object import files to be imported by the Raito CLI. Use GetDataSourceDetails() to access DataSourceDetails setters like SetAvailablePermission()

func NewDataSourceFileCreator

func NewDataSourceFileCreator(config *data_source.DataSourceSyncConfig) (DataSourceFileCreator, error)

NewDataSourceFileCreator creates a new DataSourceFileCreator based on the configuration coming from the Raito CLI.

Jump to

Keyboard shortcuts

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