lists

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: May 20, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lists

type Lists struct {
	TablesMap map[string]Model // normalized table name to table metadata (map[CQ Table Name]Model)
	// contains filtered or unexported fields
}

func NewLists

func NewLists(sp *api.SP, logger zerolog.Logger) *Lists

func (*Lists) GetDestTable

func (l *Lists) GetDestTable(listURI string, spec Spec) (*schema.Table, error)

func (*Lists) Sync

func (l *Lists) Sync(ctx context.Context, metrics *source.TableClientMetrics, res chan<- *schema.Resource, table *schema.Table) error

type Model

type Model struct {
	URI  string
	Spec Spec
}

type Spec

type Spec struct {
	// REST `$select` OData modificator, fields entity properties array
	// Wildcard selectors `*` are intentionally not supported
	// If not provided, only default fields will be fetched (ID, Created, AuthorId, Modified, EditorId)
	Select []string `json:"select"`
	// REST `$expand` OData modificator, fields entity properties array
	// When expanding an entity use selection of a nested entity property(s)
	// Optional, and in most of the cases we recommend to avoid it and
	// prefer to map nested entities to the separate tables
	Expand []string `json:"expand"`
	// REST `$filter` OData modificator, a filter string
	// Don't use filters for large entities which potentially can return more than 5000 in a view
	// such filtering will throttle no matter top limit is set
	Filter string `json:"filter"`
	// REST `$top` OData modificator, a number of items to fetch per page
	// If not provided, 5000 will be used
	// In most of the cases you don't need to change this value
	// It also can't be larger than 5000 anyways
	Top int `json:"top"`
	// Optional, an alias for the table name
	// Don't map different lists to the same table - such scenario is not supported
	Alias string `json:"alias"`
	// contains filtered or unexported fields
}

Spec is the configuration for a list source

func (*Spec) GetAlias added in v1.6.3

func (s *Spec) GetAlias(listURI string) string

GetAlias returns an alias for the list

func (*Spec) SetDefault

func (s *Spec) SetDefault()

SetDefault sets default values for list spec

func (*Spec) Validate added in v1.5.0

func (s *Spec) Validate() error

Validate validates list spec

Jump to

Keyboard shortcuts

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