common

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyFunc

type ApplyFunc func(context.Context, format.ForgePath, NodeInterface)

type ApplyOptions

type ApplyOptions struct {
	Path format.ForgePath
	Fun  ApplyFunc
}

func (*ApplyOptions) PopID

func (o *ApplyOptions) PopID() int64

func (*ApplyOptions) PopName

func (o *ApplyOptions) PopName() string

type Container

type Container struct {
	Node
	// contains filtered or unexported fields
}

func (*Container) Apply

func (o *Container) Apply(ctx context.Context, opts *ApplyOptions)

func (*Container) Delete

func (*Container) FromFormat

func (*Container) Get

func (*Container) GetFromFormat

func (o *Container) GetFromFormat(ctx context.Context, format format.Interface) ContainerElementInterface

func (*Container) GetIDMap

func (o *Container) GetIDMap() IDMapInterface

func (*Container) GetLocalMatchingRemote

func (o *Container) GetLocalMatchingRemote(ctx context.Context, object format.Interface) (string, bool)

func (*Container) GetShallow

func (o *Container) GetShallow() ContainerObjectInterface

func (*Container) Init

func (o *Container) Init(self NodeInterface, root RootInterface, parent NodeInterface, elementFactory ElementFactoryType, provider ProviderInterface)

func (*Container) List

func (*Container) MapID

func (o *Container) MapID(ctx context.Context, destination ContainerInterface, object format.Interface)

func (*Container) MapReferences

func (o *Container) MapReferences(ctx context.Context, object format.Interface, referencePaths format.ReferencePaths) format.ReferencePaths

func (*Container) Mirror

func (o *Container) Mirror(ctx context.Context, origin ContainerInterface, options *MirrorOptions)

func (*Container) ObjectToElement

func (*Container) Put

func (*Container) RemapForgePath

func (o *Container) RemapForgePath(ctx context.Context, path format.ForgePath) format.ForgePath

func (*Container) ResolveUpsert

func (o *Container) ResolveUpsert(ctx context.Context, origin ContainerInterface, object format.Interface, referencePaths format.ReferencePaths, options *MirrorOptions) ContainerElementInterface

func (*Container) ToFormat

func (*Container) Upsert

func (*Container) UpsertElement

func (*Container) Walk

func (o *Container) Walk(ctx context.Context, opts *WalkOptions)

type ContainerElement

type ContainerElement struct {
	Node
	// contains filtered or unexported fields
}

func (*ContainerElement) Apply

func (o *ContainerElement) Apply(ctx context.Context, opts *ApplyOptions)

func (*ContainerElement) ApplyChild

func (o *ContainerElement) ApplyChild(ctx context.Context, opts *ApplyOptions)

func (*ContainerElement) DefineChild

func (o *ContainerElement) DefineChild(name string, element NodeInterface)

func (*ContainerElement) DeleteObject

func (*ContainerElement) Equals

func (*ContainerElement) GetID

func (o *ContainerElement) GetID() int64

func (*ContainerElement) GetIDString

func (o *ContainerElement) GetIDString() string

func (*ContainerElement) GetObject

func (*ContainerElement) GetShallow

func (*ContainerElement) Init

func (o *ContainerElement) Init(self NodeInterface, root RootInterface, parent NodeInterface, provider ProviderInterface)

func (*ContainerElement) Mirror

func (*ContainerElement) PutObject

func (*ContainerElement) Set

func (*ContainerElement) SetID

func (o *ContainerElement) SetID(id int64)

func (*ContainerElement) SetIDString

func (o *ContainerElement) SetIDString(id string)

func (*ContainerElement) ToFormat

func (o *ContainerElement) ToFormat() format.Interface

func (*ContainerElement) Walk

func (o *ContainerElement) Walk(ctx context.Context, opts *WalkOptions)

func (*ContainerElement) WalkChild

func (o *ContainerElement) WalkChild(ctx context.Context, opts *WalkOptions)

type ContainerElementInterface

type ContainerElementInterface interface {
	GetID() int64
	SetID(int64)
	GetIDString() string
	SetIDString(string)
	IsNil() bool
	ToFormat() format.Interface
	NewFormat(int64) format.Interface
	Equals(ContainerElementInterface) bool
	Mirror(context.Context, ContainerElementInterface, *MirrorOptions)
	Walk(context.Context, *WalkOptions)
	Apply(context.Context, *ApplyOptions)

	GetShallow() ContainerObjectInterface
	Set(ContainerObjectInterface)
	GetObject(context.Context) ContainerObjectInterface
	PutObject(context.Context, ContainerObjectInterface) ContainerObjectInterface
	DeleteObject(context.Context) ContainerObjectInterface
	GetParent() ParentInterface
	GetParentObjects() []ContainerObjectInterface
	GetForgePath() format.ForgePath
	GetProvider() ProviderInterface
	GetRoot() RootInterface
	GetSelf() NodeInterface
}

type ContainerObjectInterface

type ContainerObjectInterface interface {
	GetID() int64
	SetID(int64)
	GetIDString() string
	SetIDString(string)
	IsNil() bool
	ToFormatInterface() format.Interface
}

type DefaultIDMap

type DefaultIDMap struct{}

func (*DefaultIDMap) Load

func (o *DefaultIDMap) Load()

func (*DefaultIDMap) Map

func (o *DefaultIDMap) Map(id int64) (int64, bool)

func (*DefaultIDMap) Save

func (o *DefaultIDMap) Save()

func (*DefaultIDMap) Update

func (o *DefaultIDMap) Update(from, to int64)

type DriverInterface

type DriverInterface interface {
	Init(config_types.OptionsInterface)
	GetName() string
	GetPerPage() int
	GetOptions() config_types.OptionsInterface
	SetOptions(options config_types.OptionsInterface)
	GetProvider(string, ProviderInterface) ProviderInterface
}

type ElementFactoryType

type ElementFactoryType func() ContainerElementInterface

type IDMapInterface

type IDMapInterface interface {
	Map(int64) (int64, bool)
	Update(from, to int64)
	Load()
	Save()
}

type MirrorOptions

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

func NewMirrorOptions

func NewMirrorOptions(selectors ...ContainerElementInterface) *MirrorOptions

func NewMirrorOptionsRecurse

func NewMirrorOptionsRecurse(selectors ...ContainerElementInterface) *MirrorOptions

func (*MirrorOptions) DelayedAppend

func (o *MirrorOptions) DelayedAppend(fun util.DelayedFunc)

func (*MirrorOptions) DelayedCall

func (o *MirrorOptions) DelayedCall()

func (MirrorOptions) DelayedEmpty

func (o MirrorOptions) DelayedEmpty() bool

func (MirrorOptions) GetRecurse

func (o MirrorOptions) GetRecurse() bool

func (MirrorOptions) GetResolve

func (o MirrorOptions) GetResolve() bool

func (*MirrorOptions) LastSelector

func (o *MirrorOptions) LastSelector() ContainerElementInterface

func (*MirrorOptions) PopSelector

func (o *MirrorOptions) PopSelector() ContainerElementInterface

func (*MirrorOptions) SelectorLen

func (o *MirrorOptions) SelectorLen() int

type Node

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

func (*Node) GetForgePath

func (o *Node) GetForgePath() format.ForgePath

func (*Node) GetLogger

func (o *Node) GetLogger() *config_types.Logger

func (*Node) GetParent

func (o *Node) GetParent() ParentInterface

func (*Node) GetParentObjects

func (o *Node) GetParentObjects() []ContainerObjectInterface

func (*Node) GetProvider

func (o *Node) GetProvider() ProviderInterface

func (*Node) GetRoot

func (o *Node) GetRoot() RootInterface

func (*Node) GetSelf

func (o *Node) GetSelf() NodeInterface

func (*Node) Init

func (o *Node) Init(self NodeInterface, root RootInterface, parent NodeInterface, provider ProviderInterface)

func (*Node) IsNil

func (o *Node) IsNil() bool

func (*Node) NewFormat

func (o *Node) NewFormat(int64) format.Interface

type NodeInterface

type NodeInterface interface {
	ParentInterface
	GetRoot() RootInterface
	GetSelf() NodeInterface
	NewFormat(int64) format.Interface
	Walk(context.Context, *WalkOptions)
	Apply(context.Context, *ApplyOptions)
}

type ParentInterface

type ParentInterface interface {
	IsNil() bool
	GetProvider() ProviderInterface
	GetParent() ParentInterface
	GetShallow() ContainerObjectInterface
	GetParentObjects() []ContainerObjectInterface
	GetForgePath() format.ForgePath
}

type RemapFailed

type RemapFailed string

type RootInterface

type RootInterface interface {
	GetLogger() *config_types.Logger
	GetFeatures() config_types.Features
	GetDriver() DriverInterface
	GetPerPage() int
	Walk(context.Context, *WalkOptions)
	Apply(context.Context, *ApplyOptions)
}

type WalkFunc

type WalkFunc func(context.Context, format.ForgePath, NodeInterface)

type WalkOptions

type WalkOptions struct {
	ApplyOptions
	Explore bool
}

func NewWalkOptions

func NewWalkOptions(path format.ForgePath, fun ApplyFunc, explore bool) *WalkOptions

Jump to

Keyboard shortcuts

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