service

package
v0.0.0-...-7687a33 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const FederationUserToken string = "authToken"
View Source
const (
	TokenLength = 32
)

Variables

View Source
var (
	DefaultStore store.Storer

	DefaultLogger *zap.Logger

	DefaultAccessControl *accessControl

	// CurrentSettings represents current system settings
	CurrentSettings = &types.AppSettings{}

	DefaultOptions options.FederationOpt

	DefaultActionlog actionlog.Recorder

	DefaultNode          *node
	DefaultNodeSync      NodeSyncService
	DefaultExposedModule ExposedModuleService
	DefaultSharedModule  SharedModuleService
	DefaultModuleMapping ModuleMappingService
)

Functions

func AccessControl

func AccessControl(s store.Storer) *accessControl

func AccessControlActionGrant

func AccessControlActionGrant(props ...*accessControlActionProps) *accessControlAction

AccessControlActionGrant returns "federation:access_control.grant" action

This function is auto-generated.

func AccessControlErrGeneric

func AccessControlErrGeneric(mm ...*accessControlActionProps) *errors.Error

AccessControlErrGeneric returns "federation:access_control.generic" as *errors.Error

This function is auto-generated.

func AccessControlErrNotAllowedToSetPermissions

func AccessControlErrNotAllowedToSetPermissions(mm ...*accessControlActionProps) *errors.Error

AccessControlErrNotAllowedToSetPermissions returns "federation:access_control.notAllowedToSetPermissions" as *errors.Error

This function is auto-generated.

func AddFederationLabel

func AddFederationLabel(entity label.LabeledResource, key string, value string)

func ExposedModule

func ExposedModule() *exposedModule

func ExposedModuleActionCreate

func ExposedModuleActionCreate(props ...*exposedModuleActionProps) *exposedModuleAction

ExposedModuleActionCreate returns "federation:exposed_module.create" action

This function is auto-generated.

func ExposedModuleActionDelete

func ExposedModuleActionDelete(props ...*exposedModuleActionProps) *exposedModuleAction

ExposedModuleActionDelete returns "federation:exposed_module.delete" action

This function is auto-generated.

func ExposedModuleActionLookup

func ExposedModuleActionLookup(props ...*exposedModuleActionProps) *exposedModuleAction

ExposedModuleActionLookup returns "federation:exposed_module.lookup" action

This function is auto-generated.

func ExposedModuleActionSearch

func ExposedModuleActionSearch(props ...*exposedModuleActionProps) *exposedModuleAction

ExposedModuleActionSearch returns "federation:exposed_module.search" action

This function is auto-generated.

func ExposedModuleActionUndelete

func ExposedModuleActionUndelete(props ...*exposedModuleActionProps) *exposedModuleAction

ExposedModuleActionUndelete returns "federation:exposed_module.undelete" action

This function is auto-generated.

func ExposedModuleActionUpdate

func ExposedModuleActionUpdate(props ...*exposedModuleActionProps) *exposedModuleAction

ExposedModuleActionUpdate returns "federation:exposed_module.update" action

This function is auto-generated.

func ExposedModuleErrComposeModuleNotFound

func ExposedModuleErrComposeModuleNotFound(mm ...*exposedModuleActionProps) *errors.Error

ExposedModuleErrComposeModuleNotFound returns "federation:exposed_module.composeModuleNotFound" as *errors.Error

This function is auto-generated.

func ExposedModuleErrComposeNamespaceNotFound

func ExposedModuleErrComposeNamespaceNotFound(mm ...*exposedModuleActionProps) *errors.Error

ExposedModuleErrComposeNamespaceNotFound returns "federation:exposed_module.composeNamespaceNotFound" as *errors.Error

This function is auto-generated.

func ExposedModuleErrGeneric

func ExposedModuleErrGeneric(mm ...*exposedModuleActionProps) *errors.Error

ExposedModuleErrGeneric returns "federation:exposed_module.generic" as *errors.Error

This function is auto-generated.

func ExposedModuleErrInvalidID

func ExposedModuleErrInvalidID(mm ...*exposedModuleActionProps) *errors.Error

ExposedModuleErrInvalidID returns "federation:exposed_module.invalidID" as *errors.Error

This function is auto-generated.

func ExposedModuleErrNodeNotFound

func ExposedModuleErrNodeNotFound(mm ...*exposedModuleActionProps) *errors.Error

ExposedModuleErrNodeNotFound returns "federation:exposed_module.nodeNotFound" as *errors.Error

This function is auto-generated.

func ExposedModuleErrNotAllowedToCreate

func ExposedModuleErrNotAllowedToCreate(mm ...*exposedModuleActionProps) *errors.Error

ExposedModuleErrNotAllowedToCreate returns "federation:exposed_module.notAllowedToCreate" as *errors.Error

This function is auto-generated.

func ExposedModuleErrNotAllowedToManage

func ExposedModuleErrNotAllowedToManage(mm ...*exposedModuleActionProps) *errors.Error

ExposedModuleErrNotAllowedToManage returns "federation:exposed_module.notAllowedToManage" as *errors.Error

This function is auto-generated.

func ExposedModuleErrNotFound

func ExposedModuleErrNotFound(mm ...*exposedModuleActionProps) *errors.Error

ExposedModuleErrNotFound returns "federation:exposed_module.notFound" as *errors.Error

This function is auto-generated.

func ExposedModuleErrNotUnique

func ExposedModuleErrNotUnique(mm ...*exposedModuleActionProps) *errors.Error

ExposedModuleErrNotUnique returns "federation:exposed_module.notUnique" as *errors.Error

This function is auto-generated.

func ExposedModuleErrRequestParametersInvalid

func ExposedModuleErrRequestParametersInvalid(mm ...*exposedModuleActionProps) *errors.Error

ExposedModuleErrRequestParametersInvalid returns "federation:exposed_module.requestParametersInvalid" as *errors.Error

This function is auto-generated.

func ExposedModuleErrStaleData

func ExposedModuleErrStaleData(mm ...*exposedModuleActionProps) *errors.Error

ExposedModuleErrStaleData returns "federation:exposed_module.staleData" as *errors.Error

This function is auto-generated.

func HttpHandshake

func HttpHandshake(client httpNodeHandshaker) *httpNodeHandshake

func Initialize

func Initialize(_ context.Context, log *zap.Logger, s store.Storer, c Config) (err error)

func ModuleMapping

func ModuleMapping() *moduleMapping

func ModuleMappingActionCreate

func ModuleMappingActionCreate(props ...*moduleMappingActionProps) *moduleMappingAction

ModuleMappingActionCreate returns "federation:module_mapping.create" action

This function is auto-generated.

func ModuleMappingActionDelete

func ModuleMappingActionDelete(props ...*moduleMappingActionProps) *moduleMappingAction

ModuleMappingActionDelete returns "federation:module_mapping.delete" action

This function is auto-generated.

func ModuleMappingActionLookup

func ModuleMappingActionLookup(props ...*moduleMappingActionProps) *moduleMappingAction

ModuleMappingActionLookup returns "federation:module_mapping.lookup" action

This function is auto-generated.

func ModuleMappingActionSearch

func ModuleMappingActionSearch(props ...*moduleMappingActionProps) *moduleMappingAction

ModuleMappingActionSearch returns "federation:module_mapping.search" action

This function is auto-generated.

func ModuleMappingActionUpdate

func ModuleMappingActionUpdate(props ...*moduleMappingActionProps) *moduleMappingAction

ModuleMappingActionUpdate returns "federation:module_mapping.update" action

This function is auto-generated.

func ModuleMappingErrComposeModuleNotFound

func ModuleMappingErrComposeModuleNotFound(mm ...*moduleMappingActionProps) *errors.Error

ModuleMappingErrComposeModuleNotFound returns "federation:module_mapping.composeModuleNotFound" as *errors.Error

This function is auto-generated.

func ModuleMappingErrComposeNamespaceNotFound

func ModuleMappingErrComposeNamespaceNotFound(mm ...*moduleMappingActionProps) *errors.Error

ModuleMappingErrComposeNamespaceNotFound returns "federation:module_mapping.composeNamespaceNotFound" as *errors.Error

This function is auto-generated.

func ModuleMappingErrFederationModuleNotFound

func ModuleMappingErrFederationModuleNotFound(mm ...*moduleMappingActionProps) *errors.Error

ModuleMappingErrFederationModuleNotFound returns "federation:module_mapping.federationModuleNotFound" as *errors.Error

This function is auto-generated.

func ModuleMappingErrGeneric

func ModuleMappingErrGeneric(mm ...*moduleMappingActionProps) *errors.Error

ModuleMappingErrGeneric returns "federation:module_mapping.generic" as *errors.Error

This function is auto-generated.

func ModuleMappingErrModuleMappingExists

func ModuleMappingErrModuleMappingExists(mm ...*moduleMappingActionProps) *errors.Error

ModuleMappingErrModuleMappingExists returns "federation:module_mapping.moduleMappingExists" as *errors.Error

This function is auto-generated.

func ModuleMappingErrNodeNotFound

func ModuleMappingErrNodeNotFound(mm ...*moduleMappingActionProps) *errors.Error

ModuleMappingErrNodeNotFound returns "federation:module_mapping.nodeNotFound" as *errors.Error

This function is auto-generated.

func ModuleMappingErrNotAllowedToMap

func ModuleMappingErrNotAllowedToMap(mm ...*moduleMappingActionProps) *errors.Error

ModuleMappingErrNotAllowedToMap returns "federation:module_mapping.notAllowedToMap" as *errors.Error

This function is auto-generated.

func ModuleMappingErrNotFound

func ModuleMappingErrNotFound(mm ...*moduleMappingActionProps) *errors.Error

ModuleMappingErrNotFound returns "federation:module_mapping.notFound" as *errors.Error

This function is auto-generated.

func Node

func Node(s store.Storer, u service.UserService, al actionlog.Recorder, th tokenIssuer, options options.FederationOpt, sopt options.HttpServerOpt, ac nodeAccessController) *node

func NodeActionCreate

func NodeActionCreate(props ...*nodeActionProps) *nodeAction

NodeActionCreate returns "federation:node.create" action

This function is auto-generated.

func NodeActionCreateFromPairingURI

func NodeActionCreateFromPairingURI(props ...*nodeActionProps) *nodeAction

NodeActionCreateFromPairingURI returns "federation:node.createFromPairingURI" action

This function is auto-generated.

func NodeActionDelete

func NodeActionDelete(props ...*nodeActionProps) *nodeAction

NodeActionDelete returns "federation:node.delete" action

This function is auto-generated.

func NodeActionHandshakeComplete

func NodeActionHandshakeComplete(props ...*nodeActionProps) *nodeAction

NodeActionHandshakeComplete returns "federation:node.handshakeComplete" action

This function is auto-generated.

func NodeActionHandshakeConfirm

func NodeActionHandshakeConfirm(props ...*nodeActionProps) *nodeAction

NodeActionHandshakeConfirm returns "federation:node.handshakeConfirm" action

This function is auto-generated.

func NodeActionHandshakeInit

func NodeActionHandshakeInit(props ...*nodeActionProps) *nodeAction

NodeActionHandshakeInit returns "federation:node.handshakeInit" action

This function is auto-generated.

func NodeActionLookup

func NodeActionLookup(props ...*nodeActionProps) *nodeAction

NodeActionLookup returns "federation:node.lookup" action

This function is auto-generated.

func NodeActionOttRegenerated

func NodeActionOttRegenerated(props ...*nodeActionProps) *nodeAction

NodeActionOttRegenerated returns "federation:node.ottRegenerated" action

This function is auto-generated.

func NodeActionPair

func NodeActionPair(props ...*nodeActionProps) *nodeAction

NodeActionPair returns "federation:node.pair" action

This function is auto-generated.

func NodeActionRecreateFromPairingURI

func NodeActionRecreateFromPairingURI(props ...*nodeActionProps) *nodeAction

NodeActionRecreateFromPairingURI returns "federation:node.recreateFromPairingURI" action

This function is auto-generated.

func NodeActionSearch

func NodeActionSearch(props ...*nodeActionProps) *nodeAction

NodeActionSearch returns "federation:node.search" action

This function is auto-generated.

func NodeActionUndelete

func NodeActionUndelete(props ...*nodeActionProps) *nodeAction

NodeActionUndelete returns "federation:node.undelete" action

This function is auto-generated.

func NodeActionUpdate

func NodeActionUpdate(props ...*nodeActionProps) *nodeAction

NodeActionUpdate returns "federation:node.update" action

This function is auto-generated.

func NodeErrGeneric

func NodeErrGeneric(mm ...*nodeActionProps) *errors.Error

NodeErrGeneric returns "federation:node.generic" as *errors.Error

This function is auto-generated.

func NodeErrInvalidID

func NodeErrInvalidID(mm ...*nodeActionProps) *errors.Error

NodeErrInvalidID returns "federation:node.invalidID" as *errors.Error

This function is auto-generated.

func NodeErrNotAllowedToCreate

func NodeErrNotAllowedToCreate(mm ...*nodeActionProps) *errors.Error

NodeErrNotAllowedToCreate returns "federation:node.notAllowedToCreate" as *errors.Error

This function is auto-generated.

func NodeErrNotAllowedToManage

func NodeErrNotAllowedToManage(mm ...*nodeActionProps) *errors.Error

NodeErrNotAllowedToManage returns "federation:node.notAllowedToManage" as *errors.Error

This function is auto-generated.

func NodeErrNotAllowedToPair

func NodeErrNotAllowedToPair(mm ...*nodeActionProps) *errors.Error

NodeErrNotAllowedToPair returns "federation:node.notAllowedToPair" as *errors.Error

This function is auto-generated.

func NodeErrNotAllowedToSearch

func NodeErrNotAllowedToSearch(mm ...*nodeActionProps) *errors.Error

NodeErrNotAllowedToSearch returns "federation:node.notAllowedToSearch" as *errors.Error

This function is auto-generated.

func NodeErrNotFound

func NodeErrNotFound(mm ...*nodeActionProps) *errors.Error

NodeErrNotFound returns "federation:node.notFound" as *errors.Error

This function is auto-generated.

func NodeErrPairingTokenInvalid

func NodeErrPairingTokenInvalid(mm ...*nodeActionProps) *errors.Error

NodeErrPairingTokenInvalid returns "federation:node.pairingTokenInvalid" as *errors.Error

This function is auto-generated.

func NodeErrPairingURIInvalid

func NodeErrPairingURIInvalid(mm ...*nodeActionProps) *errors.Error

NodeErrPairingURIInvalid returns "federation:node.pairingURIInvalid" as *errors.Error

This function is auto-generated.

func NodeErrPairingURISourceIDInvalid

func NodeErrPairingURISourceIDInvalid(mm ...*nodeActionProps) *errors.Error

NodeErrPairingURISourceIDInvalid returns "federation:node.pairingURISourceIDInvalid" as *errors.Error

This function is auto-generated.

func NodeErrPairingURITokenInvalid

func NodeErrPairingURITokenInvalid(mm ...*nodeActionProps) *errors.Error

NodeErrPairingURITokenInvalid returns "federation:node.pairingURITokenInvalid" as *errors.Error

This function is auto-generated.

func NodeSyncActionCreate

func NodeSyncActionCreate(props ...*nodeSyncActionProps) *nodeSyncAction

NodeSyncActionCreate returns "federation:node_sync.create" action

This function is auto-generated.

func NodeSyncActionLookup

func NodeSyncActionLookup(props ...*nodeSyncActionProps) *nodeSyncAction

NodeSyncActionLookup returns "federation:node_sync.lookup" action

This function is auto-generated.

func NodeSyncErrGeneric

func NodeSyncErrGeneric(mm ...*nodeSyncActionProps) *errors.Error

NodeSyncErrGeneric returns "federation:node_sync.generic" as *errors.Error

This function is auto-generated.

func NodeSyncErrNodeNotFound

func NodeSyncErrNodeNotFound(mm ...*nodeSyncActionProps) *errors.Error

NodeSyncErrNodeNotFound returns "federation:node_sync.nodeNotFound" as *errors.Error

This function is auto-generated.

func NodeSyncErrNotFound

func NodeSyncErrNotFound(mm ...*nodeSyncActionProps) *errors.Error

NodeSyncErrNotFound returns "federation:node_sync.notFound" as *errors.Error

This function is auto-generated.

func SharedModule

func SharedModule() *sharedModule

func SharedModuleActionCreate

func SharedModuleActionCreate(props ...*sharedModuleActionProps) *sharedModuleAction

SharedModuleActionCreate returns "federation:shared_module.create" action

This function is auto-generated.

func SharedModuleActionDelete

func SharedModuleActionDelete(props ...*sharedModuleActionProps) *sharedModuleAction

SharedModuleActionDelete returns "federation:shared_module.delete" action

This function is auto-generated.

func SharedModuleActionLookup

func SharedModuleActionLookup(props ...*sharedModuleActionProps) *sharedModuleAction

SharedModuleActionLookup returns "federation:shared_module.lookup" action

This function is auto-generated.

func SharedModuleActionSearch

func SharedModuleActionSearch(props ...*sharedModuleActionProps) *sharedModuleAction

SharedModuleActionSearch returns "federation:shared_module.search" action

This function is auto-generated.

func SharedModuleActionUndelete

func SharedModuleActionUndelete(props ...*sharedModuleActionProps) *sharedModuleAction

SharedModuleActionUndelete returns "federation:shared_module.undelete" action

This function is auto-generated.

func SharedModuleActionUpdate

func SharedModuleActionUpdate(props ...*sharedModuleActionProps) *sharedModuleAction

SharedModuleActionUpdate returns "federation:shared_module.update" action

This function is auto-generated.

func SharedModuleErrFederationSyncStructureChanged

func SharedModuleErrFederationSyncStructureChanged(mm ...*sharedModuleActionProps) *errors.Error

SharedModuleErrFederationSyncStructureChanged returns "federation:shared_module.federationSyncStructureChanged" as *errors.Error

This function is auto-generated.

func SharedModuleErrGeneric

func SharedModuleErrGeneric(mm ...*sharedModuleActionProps) *errors.Error

SharedModuleErrGeneric returns "federation:shared_module.generic" as *errors.Error

This function is auto-generated.

func SharedModuleErrInvalidID

func SharedModuleErrInvalidID(mm ...*sharedModuleActionProps) *errors.Error

SharedModuleErrInvalidID returns "federation:shared_module.invalidID" as *errors.Error

This function is auto-generated.

func SharedModuleErrNodeNotFound

func SharedModuleErrNodeNotFound(mm ...*sharedModuleActionProps) *errors.Error

SharedModuleErrNodeNotFound returns "federation:shared_module.nodeNotFound" as *errors.Error

This function is auto-generated.

func SharedModuleErrNotAllowedToCreate

func SharedModuleErrNotAllowedToCreate(mm ...*sharedModuleActionProps) *errors.Error

SharedModuleErrNotAllowedToCreate returns "federation:shared_module.notAllowedToCreate" as *errors.Error

This function is auto-generated.

func SharedModuleErrNotAllowedToManage

func SharedModuleErrNotAllowedToManage(mm ...*sharedModuleActionProps) *errors.Error

SharedModuleErrNotAllowedToManage returns "federation:shared_module.notAllowedToManage" as *errors.Error

This function is auto-generated.

func SharedModuleErrNotAllowedToMap

func SharedModuleErrNotAllowedToMap(mm ...*sharedModuleActionProps) *errors.Error

SharedModuleErrNotAllowedToMap returns "federation:shared_module.notAllowedToMap" as *errors.Error

This function is auto-generated.

func SharedModuleErrNotFound

func SharedModuleErrNotFound(mm ...*sharedModuleActionProps) *errors.Error

SharedModuleErrNotFound returns "federation:shared_module.notFound" as *errors.Error

This function is auto-generated.

func SharedModuleErrNotUnique

func SharedModuleErrNotUnique(mm ...*sharedModuleActionProps) *errors.Error

SharedModuleErrNotUnique returns "federation:shared_module.notUnique" as *errors.Error

This function is auto-generated.

func SharedModuleErrStaleData

func SharedModuleErrStaleData(mm ...*sharedModuleActionProps) *errors.Error

SharedModuleErrStaleData returns "federation:shared_module.staleData" as *errors.Error

This function is auto-generated.

func Watchers

func Watchers(ctx context.Context)

func WorkerData

func WorkerData(sync *Sync, logger *zap.Logger) *syncWorkerData

func WorkerStructure

func WorkerStructure(sync *Sync, logger *zap.Logger) *syncWorkerStructure

Types

type AuxResponseSet

type AuxResponseSet struct {
	Response struct {
		Filter struct {
			NodeID          string
			ComposeModuleID string
			Query           string
			Limit           int
			NextPage        string
			PrevPage        string
		} `json:"filter"`
	} `json:"response"`
}

type Config

type Config struct {
	ActionLog  options.ActionLogOpt
	Storage    options.ObjectStoreOpt
	Federation options.FederationOpt
	Server     options.HttpServerOpt
}

type ExposedModuleService

type ExposedModuleService interface {
	Create(ctx context.Context, new *types.ExposedModule) (*types.ExposedModule, error)
	Update(ctx context.Context, updated *types.ExposedModule) (*types.ExposedModule, error)
	Find(ctx context.Context, filter types.ExposedModuleFilter) (types.ExposedModuleSet, types.ExposedModuleFilter, error)
	FindByID(ctx context.Context, nodeID uint64, moduleID uint64) (*types.ExposedModule, error)
	DeleteByID(ctx context.Context, nodeID, moduleID uint64) (*types.ExposedModule, error)
}

type Mapper

type Mapper struct{}

func (*Mapper) Merge

func (m *Mapper) Merge(in *ct.RecordValueSet, out *ct.RecordValueSet, mappings *types.ModuleFieldMappingSet)

Merge copies the values from originating structure do the destination

mostly, there will be less mapped fields on the destination side, so start looping from here

func (*Mapper) Prepare

func (m *Mapper) Prepare(mappings types.ModuleFieldMappingSet) (out ct.RecordValueSet)

Prepare creates a set of Records to be used later when the fields will be mapped via Merge()

type ModuleMappingService

type ModuleMappingService interface {
	Find(ctx context.Context, filter types.ModuleMappingFilter) (types.ModuleMappingSet, types.ModuleMappingFilter, error)
	FindByID(ctx context.Context, federationModuleID uint64) (*types.ModuleMapping, error)
	Create(ctx context.Context, new *types.ModuleMapping) (*types.ModuleMapping, error)
	Update(ctx context.Context, updated *types.ModuleMapping) (*types.ModuleMapping, error)
}

type NodeSyncService

type NodeSyncService interface {
	Create(ctx context.Context, new *types.NodeSync) (*types.NodeSync, error)
	Search(ctx context.Context, f types.NodeSyncFilter) (types.NodeSyncSet, types.NodeSyncFilter, error)
	LookupLastSuccessfulSync(ctx context.Context, nodeID uint64, syncType string) (*types.NodeSync, error)
}

func NodeSync

func NodeSync() NodeSyncService

type Payload

type Payload struct {
	Payload io.Reader
	Meta    Processer
}

type Processer

type Processer interface {
	Process(ctx context.Context, payload []byte) (ProcesserResponse, error)
}

type ProcesserResponse

type ProcesserResponse interface{}

type SharedModuleService

type SharedModuleService interface {
	Create(ctx context.Context, new *types.SharedModule) (*types.SharedModule, error)
	Update(ctx context.Context, updated *types.SharedModule) (*types.SharedModule, error)
	Find(ctx context.Context, filter types.SharedModuleFilter) (types.SharedModuleSet, types.SharedModuleFilter, error)
	FindByID(ctx context.Context, nodeID uint64, moduleID uint64) (*types.SharedModule, error)
}

type Sync

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

func (*Sync) CanUpdateSharedModule

func (s *Sync) CanUpdateSharedModule(ctx context.Context, new *types.SharedModule, existing *types.SharedModule) (bool, error)

CanUpdateSharedModule checks the origin and destination module compatibility of fields It currently checks if all of the fields are exactly the same TODO - check if any of the newly missing fields are actually being used so a safe update is possible

func (*Sync) CreateRecord

func (s *Sync) CreateRecord(ctx context.Context, rec *ct.Record) (out *ct.Record, err error)

CreateRecord wraps the compose Record service Create

func (*Sync) CreateSharedModule

func (s *Sync) CreateSharedModule(ctx context.Context, new *types.SharedModule) (*types.SharedModule, error)

CreateSharedModule wraps the federation SharedModule service Create

func (*Sync) DeleteRecord

func (s *Sync) DeleteRecord(ctx context.Context, rec *ct.Record) error

DeleteRecord wraps the compose Record service Update

func (*Sync) FetchUrl

func (s *Sync) FetchUrl(ctx context.Context, url string) (io.Reader, error)

FetchUrl passes the url to be fetched to the syncer

func (*Sync) FindRecords

func (s *Sync) FindRecords(ctx context.Context, filter ct.RecordFilter) (set ct.RecordSet, err error)

FindRecord find the record via federation label

func (*Sync) GetLastStructureSyncStatus

func (s *Sync) GetLastStructureSyncStatus(ctx context.Context, nodeID, externalFederationModuleID uint64) (syncStatus string, err error)

func (*Sync) GetLastSyncTime

func (s *Sync) GetLastSyncTime(ctx context.Context, nodeID uint64, syncType string) (*time.Time, error)

func (*Sync) GetModuleMappings

func (s *Sync) GetModuleMappings(ctx context.Context, moduleID uint64) (out *types.ModuleMapping, err error)

func (*Sync) GetPairedNodes

func (s *Sync) GetPairedNodes(ctx context.Context) (types.NodeSet, error)

GetPairedNodes finds successfuly paired nodes

func (*Sync) GetSharedModules

func (s *Sync) GetSharedModules(ctx context.Context, nodeID uint64) (types.SharedModuleSet, error)

func (*Sync) LoadUserWithRoles

func (s *Sync) LoadUserWithRoles(ctx context.Context, nodeID uint64) (*st.User, error)

LoadUserWithRoles gets the federation user, that was created at node pairing process

func (*Sync) LookupSharedModule

func (s *Sync) LookupSharedModule(ctx context.Context, new *types.SharedModule) (*types.SharedModule, error)

LookupSharedModule find the shared module if exists

func (*Sync) PrepareModuleMappings

func (s *Sync) PrepareModuleMappings(ctx context.Context, mappings *types.ModuleMapping) (ct.RecordValueSet, error)

func (*Sync) ProcessPayload

func (s *Sync) ProcessPayload(ctx context.Context, payload []byte, out chan Url, url types.SyncerURI, processer Processer) (ProcesserResponse, error)

ProcessPayload passes the payload to the syncer lib

func (*Sync) QueueUrl

func (s *Sync) QueueUrl(url Url, out chan Url)

QueueUrl passes the url to the syncer

func (*Sync) UpdateRecord

func (s *Sync) UpdateRecord(ctx context.Context, rec *ct.Record) (out *ct.Record, err error)

UpdateRecord wraps the compose Record service Update

func (*Sync) UpdateSharedModule

func (s *Sync) UpdateSharedModule(ctx context.Context, updated *types.SharedModule) (*types.SharedModule, error)

UpdateSharedModule wraps the federation SharedModule service Update

type Syncer

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

func NewSyncer

func NewSyncer() *Syncer

func (*Syncer) Fetch

func (h *Syncer) Fetch(ctx context.Context, url string) (io.Reader, error)

func (*Syncer) ParseHeader

func (h *Syncer) ParseHeader(ctx context.Context, payload []byte) (aux AuxResponseSet, err error)

func (*Syncer) Process

func (h *Syncer) Process(ctx context.Context, payload []byte, out chan Url, url types.SyncerURI, processer Processer) (ProcesserResponse, error)

func (*Syncer) Queue

func (h *Syncer) Queue(url Url, out chan Url)

type Url

type Url struct {
	Url  types.SyncerURI
	Meta Processer
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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