Documentation
¶
Overview ¶
package storage provides access to the data loader for filesystem storage
FileSystem storage is used to store data in the filesystem. Structure of the data is stored in the following way:
- format*.json - list of formats
- {format: {...single object...}, formats: [{...list of objects...}]
- account*.json - list of accounts
- {account: {...single object...}, accounts: [{...list of objects...}]
- campaign*.json - list of campaigns
- {campaign: {...single object...}, campaigns: [{...list of objects...}]
- zone*.json - list of zones
- {zone: {...single object...}, zones: [{...list of objects...}]
- rtb_source*.json - list of RTB sources
- {rtb_source: {...single object...}, rtb_sources: [{...list of objects...}]
- rtb_access_point*.json - list of RTB access points
- {rtb_access_point: {...single object...}, rtb_access_points: [{...list of objects...}]
Each type of objects from the list of different files will be merged into a single list
Index ¶
- func DBDataAccessor[AccType any](ctx context.Context, u *url.URL) any
- func FSDataAccessor[AccType any](ctx context.Context, u *url.URL) any
- func NewDataAccessor[T any, AccType any](conn any, dbtarget, fstarget loader.LoaderTarget[T], ...) (loader.DataAccessor[T], error)
- func Register(scheme string, fnk DataLoaderConnectFnk)
- func RegisterAllSchemas[AccType any]()
- type AllAccessor
- func (acc *AllAccessor[AccType]) Accounts() (*accountaccessor.AccountAccessor[AccType], error)
- func (acc *AllAccessor[AccType]) Apps() (*appaccessor.AppAccessor, error)
- func (acc *AllAccessor[AccType]) Conn() any
- func (acc *AllAccessor[AccType]) Formats() (types.FormatsAccessor, error)
- func (acc *AllAccessor[AccType]) Sources(factories []adsourceaccessor.SourceFactory, ...) (*adsourceaccessor.Accessor[AccType], error)
- func (acc *AllAccessor[AccType]) TrafficRouters() (*trafficrouteraccessor.TrafficRouterAccessor, error)
- func (acc *AllAccessor[AccType]) Zones() (*zoneaccessor.ZoneAccessor, error)
- type AllDataAccessor
- type DataLoaderConnectFnk
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DBDataAccessor ¶
DBDataAccessor provides access to the data loader for database storage
func FSDataAccessor ¶
FSDataAccessor provides access to the data loader for filesystem storage
func NewDataAccessor ¶
func NewDataAccessor[T any, AccType any](conn any, dbtarget, fstarget loader.LoaderTarget[T], pattern, metricName string) (loader.DataAccessor[T], error)
func RegisterAllSchemas ¶
func RegisterAllSchemas[AccType any]()
RegisterAllSchemas for all supported dialects
Types ¶
type AllAccessor ¶
type AllAccessor[AccType any] struct { // contains filtered or unexported fields }
func ConnectAllAccessors ¶
func ConnectAllAccessors[AccType any](ctx context.Context, urlConnect string, accountCast accountaccessor.AccountConvertFunc[AccType]) (*AllAccessor[AccType], error)
ConnectAllAccessors to the dataLoader accessor
func NewAllAccessor ¶
func NewAllAccessor[AccType any](ctx context.Context, accessors AllDataAccessor[AccType], accountCast accountaccessor.AccountConvertFunc[AccType]) *AllAccessor[AccType]
func (*AllAccessor[AccType]) Accounts ¶
func (acc *AllAccessor[AccType]) Accounts() (*accountaccessor.AccountAccessor[AccType], error)
func (*AllAccessor[AccType]) Apps ¶
func (acc *AllAccessor[AccType]) Apps() (*appaccessor.AppAccessor, error)
func (*AllAccessor[AccType]) Conn ¶
func (acc *AllAccessor[AccType]) Conn() any
func (*AllAccessor[AccType]) Formats ¶
func (acc *AllAccessor[AccType]) Formats() (types.FormatsAccessor, error)
func (*AllAccessor[AccType]) Sources ¶
func (acc *AllAccessor[AccType]) Sources(factories []adsourceaccessor.SourceFactory, opts ...adsourceaccessor.Option[AccType]) (*adsourceaccessor.Accessor[AccType], error)
func (*AllAccessor[AccType]) TrafficRouters ¶
func (acc *AllAccessor[AccType]) TrafficRouters() (*trafficrouteraccessor.TrafficRouterAccessor, error)
func (*AllAccessor[AccType]) Zones ¶
func (acc *AllAccessor[AccType]) Zones() (*zoneaccessor.ZoneAccessor, error)
type AllDataAccessor ¶
type AllDataAccessor[AccType any] interface { Formats() (loader.DataAccessor[models.Format], error) Accounts() (loader.DataAccessor[AccType], error) Apps() (loader.DataAccessor[models.Application], error) Zones() (loader.DataAccessor[models.Zone], error) RTBSources() (loader.DataAccessor[models.RTBSource], error) TrafficRouters() (loader.DataAccessor[models.TrafficRouter], error) }
AllDataAccessor provides access to the data loader