types

package
v0.0.0-...-2873e01 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NodeResourceType          = "corteza::federation:node"
	NodeSyncResourceType      = "corteza::federation:node-sync"
	ExposedModuleResourceType = "corteza::federation:exposed-module"
	SharedModuleResourceType  = "corteza::federation:shared-module"
	ModuleMappingResourceType = "corteza::federation:module-mapping"
	ComponentResourceType     = "corteza::federation"
)

Variables

View Source
var (
	NodeStatusPending       = "pending"
	NodeStatusPairRequested = "pair_requested"
	NodeStatusPaired        = "paired"
)
View Source
var (
	NodeSyncTypeStructure = "sync_structure"
	NodeSyncTypeData      = "sync_data"
	NodeSyncStatusSuccess = "success"
	NodeSyncStatusError   = "error"
)

Functions

func ComponentRbacResource

func ComponentRbacResource() string

ComponentRbacResource returns string representation of RBAC resource for Component

RBAC resource is in the corteza::federation/ format

This function is auto-generated

func ComponentRbacResourceTpl

func ComponentRbacResourceTpl() string

func ExposedModuleRbacResource

func ExposedModuleRbacResource(nodeID uint64, id uint64) string

ExposedModuleRbacResource returns string representation of RBAC resource for ExposedModule

RBAC resource is in the corteza::federation:exposed-module/... format

This function is auto-generated

func ExposedModuleRbacResourceTpl

func ExposedModuleRbacResourceTpl() string

func NodeRbacResource

func NodeRbacResource(id uint64) string

NodeRbacResource returns string representation of RBAC resource for Node

RBAC resource is in the corteza::federation:node/... format

This function is auto-generated

func NodeRbacResourceTpl

func NodeRbacResourceTpl() string

func SharedModuleRbacResource

func SharedModuleRbacResource(nodeID uint64, id uint64) string

SharedModuleRbacResource returns string representation of RBAC resource for SharedModule

RBAC resource is in the corteza::federation:shared-module/... format

This function is auto-generated

func SharedModuleRbacResourceTpl

func SharedModuleRbacResourceTpl() string

Types

type Component

type Component struct{}

Component struct serves as a virtual resource type for the federation component

This struct is auto-generated

func (Component) RbacResource

func (r Component) RbacResource() string

RbacResource returns string representation of RBAC resource for Component by calling ComponentRbacResource fn

RBAC resource is in the corteza::federation/... format

This function is auto-generated

type ExposedModule

type ExposedModule struct {
	ID                 uint64         `json:"moduleID,string"`
	NodeID             uint64         `json:"nodeID,string"`
	ComposeModuleID    uint64         `json:"composeModuleID,string"`
	ComposeNamespaceID uint64         `json:"composeNamespaceID,string"`
	Handle             string         `json:"handle"`
	Name               string         `json:"name"`
	Fields             ModuleFieldSet `json:"fields"`

	CreatedAt time.Time  `json:"createdAt,omitempty"`
	CreatedBy uint64     `json:"createdBy,string" `
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`
	UpdatedBy uint64     `json:"updatedBy,string,omitempty" `
	DeletedAt *time.Time `json:"deletedAt,omitempty"`
	DeletedBy uint64     `json:"deletedBy,string,omitempty" `
}

func (ExposedModule) GetID

func (r ExposedModule) GetID() uint64

func (*ExposedModule) GetValue

func (r *ExposedModule) GetValue(name string, pos uint) (any, error)

func (ExposedModule) RbacResource

func (r ExposedModule) RbacResource() string

RbacResource returns string representation of RBAC resource for ExposedModule by calling ExposedModuleRbacResource fn

RBAC resource is in the corteza::federation:exposed-module/... format

This function is auto-generated

func (*ExposedModule) SetValue

func (r *ExposedModule) SetValue(name string, pos uint, value any) (err error)

type ExposedModuleFilter

type ExposedModuleFilter struct {
	NodeID             uint64 `json:"nodeID,string"`
	ComposeModuleID    uint64 `json:"composeModuleID,string"`
	ComposeNamespaceID uint64 `json:"composeNamespaceID,string"`

	LastSync uint64 `json:"lastSync"`
	Handle   string `json:"handle"`
	Name     string `json:"name"`
	Query    string `json:"query"`

	Check func(*ExposedModule) (bool, error) `json:"-"`

	filter.Sorting
	filter.Paging
}

type ExposedModuleSet

type ExposedModuleSet []*ExposedModule

ExposedModuleSet slice of ExposedModule

This type is auto-generated.

func (ExposedModuleSet) Filter

func (set ExposedModuleSet) Filter(f func(*ExposedModule) (bool, error)) (out ExposedModuleSet, err error)

Filter iterates through every slice item, calls f(ExposedModule) (bool, err) and return filtered slice

This function is auto-generated.

func (ExposedModuleSet) FindByID

func (set ExposedModuleSet) FindByID(ID uint64) *ExposedModule

FindByID finds items from slice by its ID property

This function is auto-generated.

func (ExposedModuleSet) IDs

func (set ExposedModuleSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (ExposedModuleSet) Walk

func (set ExposedModuleSet) Walk(w func(*ExposedModule) error) (err error)

Walk iterates through every slice item and calls w(ExposedModule) err

This function is auto-generated.

type ModuleField

type ModuleField struct {
	Kind    string `json:"kind"`
	Name    string `json:"name"`
	Label   string `json:"label"`
	IsMulti bool   `json:"isMulti"`
}

type ModuleFieldMapping

type ModuleFieldMapping struct {
	Origin      ModuleField `json:"origin"`
	Destination ModuleField `json:"destination"`
}

type ModuleFieldMappingSet

type ModuleFieldMappingSet []*ModuleFieldMapping

func (*ModuleFieldMappingSet) FindByName

Find looks up a origin or destination mapping

func (*ModuleFieldMappingSet) Scan

func (list *ModuleFieldMappingSet) Scan(src any) error

func (ModuleFieldMappingSet) Value

func (list ModuleFieldMappingSet) Value() (driver.Value, error)

type ModuleFieldMappingSetFindType

type ModuleFieldMappingSetFindType int
const (
	ModuleFieldMappingSetFindTypeOrigin ModuleFieldMappingSetFindType = iota
	ModuleFieldMappingSetFindTypeDestination
)

type ModuleFieldSet

type ModuleFieldSet []*ModuleField

func (ModuleFieldSet) HasField

func (list ModuleFieldSet) HasField(name string) (bool, error)

HasField checks if the fieldset has a value by name keeping error field to better match the existing Filter() methods in generated sets

func (*ModuleFieldSet) Scan

func (list *ModuleFieldSet) Scan(src any) error

func (ModuleFieldSet) Value

func (list ModuleFieldSet) Value() (driver.Value, error)

type ModuleMapping

type ModuleMapping struct {
	NodeID             uint64                `json:"nodeID,string"`
	FederationModuleID uint64                `json:"federationModuleID,string"`
	ComposeModuleID    uint64                `json:"composeModuleID,string"`
	ComposeNamespaceID uint64                `json:"composeNamespaceID,string"`
	FieldMapping       ModuleFieldMappingSet `json:"fields"`
}

func (ModuleMapping) GetID

func (r ModuleMapping) GetID() uint64

func (*ModuleMapping) GetValue

func (r *ModuleMapping) GetValue(name string, pos uint) (any, error)

func (*ModuleMapping) SetValue

func (r *ModuleMapping) SetValue(name string, pos uint, value any) (err error)

type ModuleMappingFilter

type ModuleMappingFilter struct {
	NodeID             uint64 `json:"nodeID"`
	ComposeModuleID    uint64 `json:"composeModuleID"`
	ComposeNamespaceID uint64 `json:"composeNamespaceID"`
	FederationModuleID uint64 `json:"federationModuleID"`
	Query              string `json:"query"`

	Check func(*ModuleMapping) (bool, error) `json:"-"`

	filter.Sorting
	filter.Paging
}

type ModuleMappingSet

type ModuleMappingSet []*ModuleMapping

ModuleMappingSet slice of ModuleMapping

This type is auto-generated.

func (ModuleMappingSet) Filter

func (set ModuleMappingSet) Filter(f func(*ModuleMapping) (bool, error)) (out ModuleMappingSet, err error)

Filter iterates through every slice item, calls f(ModuleMapping) (bool, err) and return filtered slice

This function is auto-generated.

func (ModuleMappingSet) Walk

func (set ModuleMappingSet) Walk(w func(*ModuleMapping) error) (err error)

Walk iterates through every slice item and calls w(ModuleMapping) err

This function is auto-generated.

type Node

type Node struct {
	ID     uint64 `json:"nodeID,string"`
	Name   string `json:"name"`
	Status string `json:"status"`

	// Base URL of the remote server
	BaseURL string `json:"baseURL"`

	Contact string `json:"contact"`

	// Node ID on the remote server that points back to us
	SharedNodeID uint64 `json:"sharedNodeID,string"`

	PairToken string `json:"-"`
	AuthToken string `json:"-"`

	CreatedAt time.Time  `json:"createdAt,omitempty"`
	CreatedBy uint64     `json:"createdBy,string" `
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`
	UpdatedBy uint64     `json:"updatedBy,string,omitempty" `
	DeletedAt *time.Time `json:"deletedAt,omitempty"`
	DeletedBy uint64     `json:"deletedBy,string,omitempty" `
}

func (Node) GetID

func (r Node) GetID() uint64

func (*Node) GetValue

func (r *Node) GetValue(name string, pos uint) (any, error)

func (Node) RbacResource

func (r Node) RbacResource() string

RbacResource returns string representation of RBAC resource for Node by calling NodeRbacResource fn

RBAC resource is in the corteza::federation:node/... format

This function is auto-generated

func (*Node) SetValue

func (r *Node) SetValue(name string, pos uint, value any) (err error)

type NodeFilter

type NodeFilter struct {
	Query  string `json:"name"`
	Status string `json:"status"`

	// Check fn is called by store backend for each resource found function can
	// modify the resource and return false if store should not return it
	//
	// Store then loads additional resources to satisfy the paging parameters
	Check func(node *Node) (bool, error) `json:"-"`

	Deleted filter.State `json:"deleted"`

	// Standard helpers for paging and sorting
	filter.Sorting
	filter.Paging
}

type NodeSet

type NodeSet []*Node

NodeSet slice of Node

This type is auto-generated.

func (NodeSet) Filter

func (set NodeSet) Filter(f func(*Node) (bool, error)) (out NodeSet, err error)

Filter iterates through every slice item, calls f(Node) (bool, err) and return filtered slice

This function is auto-generated.

func (NodeSet) FindByID

func (set NodeSet) FindByID(ID uint64) *Node

FindByID finds items from slice by its ID property

This function is auto-generated.

func (NodeSet) IDs

func (set NodeSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (NodeSet) Walk

func (set NodeSet) Walk(w func(*Node) error) (err error)

Walk iterates through every slice item and calls w(Node) err

This function is auto-generated.

type NodeSync

type NodeSync struct {
	NodeID     uint64 `json:"nodeID,string"`
	ModuleID   uint64 `json:"moduleID,string"`
	SyncStatus string `json:"syncStatus"`
	SyncType   string `json:"syncType"`

	TimeOfAction time.Time `json:"timeOfAction"`
}

func (NodeSync) GetID

func (r NodeSync) GetID() uint64

func (*NodeSync) GetValue

func (r *NodeSync) GetValue(name string, pos uint) (any, error)

func (*NodeSync) SetValue

func (r *NodeSync) SetValue(name string, pos uint, value any) (err error)

type NodeSyncFilter

type NodeSyncFilter struct {
	NodeID     uint64 `json:"nodeID"`
	ModuleID   uint64 `json:"moduleID"`
	SyncStatus string `json:"syncStatus"`
	SyncType   string `json:"syncType"`

	Query string `json:"name"`

	Check func(*NodeSync) (bool, error) `json:"-"`

	filter.Sorting
	filter.Paging
}

type NodeSyncSet

type NodeSyncSet []*NodeSync

NodeSyncSet slice of NodeSync

This type is auto-generated.

func (NodeSyncSet) Filter

func (set NodeSyncSet) Filter(f func(*NodeSync) (bool, error)) (out NodeSyncSet, err error)

Filter iterates through every slice item, calls f(NodeSync) (bool, err) and return filtered slice

This function is auto-generated.

func (NodeSyncSet) Walk

func (set NodeSyncSet) Walk(w func(*NodeSync) error) (err error)

Walk iterates through every slice item and calls w(NodeSync) err

This function is auto-generated.

type SharedModule

type SharedModule struct {
	ID                         uint64         `json:"moduleID,string"`
	NodeID                     uint64         `json:"nodeID,string"`
	Handle                     string         `json:"handle"`
	Name                       string         `json:"name"`
	ExternalFederationModuleID uint64         `json:"externalFederationModuleID,string"`
	Fields                     ModuleFieldSet `json:"fields"`

	CreatedAt time.Time  `json:"createdAt,omitempty"`
	CreatedBy uint64     `json:"createdBy,string" `
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`
	UpdatedBy uint64     `json:"updatedBy,string,omitempty" `
	DeletedAt *time.Time `json:"deletedAt,omitempty"`
	DeletedBy uint64     `json:"deletedBy,string,omitempty" `
}

func (SharedModule) GetID

func (r SharedModule) GetID() uint64

func (*SharedModule) GetValue

func (r *SharedModule) GetValue(name string, pos uint) (any, error)

func (SharedModule) RbacResource

func (r SharedModule) RbacResource() string

RbacResource returns string representation of RBAC resource for SharedModule by calling SharedModuleRbacResource fn

RBAC resource is in the corteza::federation:shared-module/... format

This function is auto-generated

func (*SharedModule) SetValue

func (r *SharedModule) SetValue(name string, pos uint, value any) (err error)

type SharedModuleFilter

type SharedModuleFilter struct {
	NodeID                     uint64 `json:"nodeID,string"`
	ExternalFederationModuleID uint64 `json:"externalFederationModuleID,string"`

	Handle string `json:"handle"`
	Name   string `json:"name"`
	Query  string `json:"query"`

	Check func(*SharedModule) (bool, error) `json:"-"`

	filter.Sorting
	filter.Paging
}

type SharedModuleSet

type SharedModuleSet []*SharedModule

SharedModuleSet slice of SharedModule

This type is auto-generated.

func (SharedModuleSet) Filter

func (set SharedModuleSet) Filter(f func(*SharedModule) (bool, error)) (out SharedModuleSet, err error)

Filter iterates through every slice item, calls f(SharedModule) (bool, err) and return filtered slice

This function is auto-generated.

func (SharedModuleSet) FindByID

func (set SharedModuleSet) FindByID(ID uint64) *SharedModule

FindByID finds items from slice by its ID property

This function is auto-generated.

func (SharedModuleSet) IDs

func (set SharedModuleSet) IDs() (IDs []uint64)

IDs returns a slice of uint64s from all items in the set

This function is auto-generated.

func (SharedModuleSet) Walk

func (set SharedModuleSet) Walk(w func(*SharedModule) error) (err error)

Walk iterates through every slice item and calls w(SharedModule) err

This function is auto-generated.

type SyncerURI

type SyncerURI struct {
	Limit    int
	LastSync *time.Time
	Path     string
	BaseURL  string
	NextPage string
	LastPage string
}

SyncerURI serves as a default struct for handling url queues for fetcher

func (*SyncerURI) Parse

func (s *SyncerURI) Parse(uri string) error

Parse the uri to the struct

func (*SyncerURI) String

func (s *SyncerURI) String() (string, error)

Does the transformation to string, does not url encode page cursor, since it needs to be base64 encoded

Jump to

Keyboard shortcuts

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