Documentation ¶
Overview ¶
Package common provides a library of tools used by all pydio services
Index ¶
Constants ¶
const ( ServiceNats = "nats" ServiceLog = "log" ServiceConfig = "config" ServiceInstall = "install" ServiceUpdate = "update" ServiceHealthCheck = "healthcheck" ServiceTagIdm = "idm" ServiceTagScheduler = "scheduler" ServiceTagData = "data" ServiceTagDatasource = "datasource" ServiceTagBroker = "broker" ServiceTagGateway = "gateway" ServiceTagDiscovery = "discovery" ServiceTagFrontend = "frontend" ServiceAcl = "acl" ServiceRole = "role" ServiceUser = "user" ServiceAuth = "auth" ServiceOAuth = "oauth" ServiceToken = "token" ServiceWorkspace = "workspace" ServicePolicy = "policy" ServiceGraph = "graph" ServiceUserMeta = "user-meta" ServiceUserKey = "user-key" ServiceTree = "tree" ServiceMeta = "meta" ServiceEncKey = "data-key" ServiceSearch = "search" ServiceChanges = "changes" ServiceSync = "sync" ServiceTemplates = "templates" ServiceActivity = "activity" ServiceMailer = "mailer" ServiceWebSocket = "websocket" ServiceChat = "chat" ServiceFrontend = "frontend" ServiceFrontStatics = "statics" ServiceTimer = "timer" ServiceJobs = "jobs" ServiceTasks = "tasks" ServiceVersions = "versions" ServiceDocStore = "docstore" ServiceData_ = "data." ServiceDataIndex = ServiceData_ + "index" ServiceDataObjects = ServiceData_ + "objects" ServiceDataSync = ServiceData_ + "sync" ServiceDataIndex_ = ServiceDataIndex + "." ServiceDataObjects_ = ServiceDataObjects + "." ServiceDataSync_ = ServiceDataSync + "." ServiceGrpcNamespace_ = "pydio.grpc." ServiceWebNamespace_ = "pydio.web." ServiceRestNamespace_ = "pydio.rest." ServiceGatewayNamespace_ = "pydio.gateway." ServiceTestNamespace_ = "pydio.test." ServiceGatewayProxy = ServiceGatewayNamespace_ + "proxy" ServiceGatewayData = ServiceGatewayNamespace_ + "data" ServiceGatewayGrpc = ServiceGatewayNamespace_ + "grpc" ServiceGatewayGrpcClear = ServiceGatewayNamespace_ + "grpc.clear" ServiceGatewayDav = ServiceGatewayNamespace_ + "dav" ServiceGatewayWopi = ServiceGatewayNamespace_ + "wopi" ServiceMicroApi = ServiceGatewayNamespace_ + "rest" )
Defines all constants for services names.
const ( TopicServiceRegistration = "topic.pydio.service.registration" TopicProxyRestarted = "topic.pydio.proxy.restarted" TopicServiceStop = "topic.pydio.service.stop" // @todo This is used in "stop" command but probably out-of-date EventTypeServiceRegistered = "registered" EventTypeServiceUnregistered = "unregistered" EventHeaderServiceRegisterService = "x-service-name" EventHeaderServiceRegisterPeer = "x-service-peer" EventTypeDebugPrintInternals = "debug" TopicReloadAssets = "topic.pydio.assets.reload" TopicIndexChanges = "topic.pydio.index.nodes.changes" TopicTreeChanges = "topic.pydio.tree.nodes.changes" TopicMetaChanges = "topic.pydio.meta.nodes.changes" TopicTimerEvent = "topic.pydio.meta.timer.event" TopicJobConfigEvent = "topic.pydio.jobconfig.event" TopicJobTaskEvent = "topic.pydio.jobconfig.event" TopicIdmEvent = "topic.pydio.idm.event" TopicActivityEvent = "topic.pydio.activity.event" TopicChatEvent = "topic.pydio.chat.event" TopicDatasourceEvent = "topic.pydio.datasource.event" TopicIndexEvent = "topic.pydio.index.event" )
Define constants for Event Bus Topics
const ( MetaNamespaceDatasourceName = "pydio:meta-data-source-name" MetaNamespaceDatasourcePath = "pydio:meta-data-source-path" MetaNamespaceNodeTestLocalFolder = "pydio:test:local-folder-storage" MetaNamespaceRecycleRestore = "pydio:recycle_restore" MetaNamespaceNodeName = "name" RecycleBinName = "recycle_bin" PydioThumbstoreNamespace = "pydio-thumbstore" PydioDocstoreBinariesNamespace = "pydio-binaries" PydioVersionsNamespace = "versions-store" )
Define constants for metadata and fixed datasources
const ( PydioContextUserKey = "X-Pydio-User" PydioSystemUsername = "pydio.system.user" PydioS3AnonUsername = "pydio.anon.user" PydioSyncHiddenFile = ".pydio" XAmzMetaClearSize = "X-Amz-Meta-Pydio-Clear-Size" XAmzMetaClearSizeUnkown = "unknown" XAmzMetaNodeUuid = "X-Amz-Meta-Pydio-Node-Uuid" XAmzMetaContentMd5 = "X-Amz-Meta-Content-Md5" XAmzMetaDirective = "X-Amz-Metadata-Directive" XPydioClientUuid = "X-Pydio-Client-Uuid" XPydioSessionUuid = "X-Pydio-Session" XPydioIndexationSessionUuid = "X-Pydio-Indexation-Session" XPydioFrontendSessionUuid = "X-Pydio-Frontend-Session" XPydioMoveUuid = "X-Pydio-Move" SyncSessionClose_ = "close-" SyncSessionPrefixCopy = "copy-" SyncSessionPrefixMove = "move-" PydioProfileAdmin = "admin" PydioProfileStandard = "standard" PydioProfileAnon = "anon" KeyringMasterKey = "keyring.master" MetaFlagReadonly = "node_readonly" MetaFlagLevelReadonly = "level_readonly" MetaFlagEncrypted = "datasource_encrypted" MetaFlagVersioning = "datasource_versioning" MetaFlagWorkspaceRoot = "ws_root" MetaFlagWorkspaceScope = "ws_scope" MetaFlagWorkspaceSyncable = "ws_syncable" MetaFlagWorkspacePermissions = "ws_permissions" MetaFlagWorkspaceLabel = "ws_label" MetaFlagWorkspaceDescription = "ws_description" MetaFlagWorkspaceSlug = "ws_slug" MetaFlagWorkspaceUuid = "ws_uuid" MetaFlagVirtualRoot = "virtual_root" MetaFlagBucket = "ds_bucket" NodeFlagEtagTemporary = "temporary" )
Additional constants for authentication/authorization aspects
const ( DocStoreIdSelections = "selections" DocStoreIdVirtualNodes = "virtualnodes" DocStoreIdVersioningPolicies = "versioningPolicies" DocStoreIdResetPassKeys = "resetPasswordKeys" )
DocStore constants for StoreID's
const ( KEY_MSG_ID = "MsgId" KEY_TS = "Ts" KEY_NANO = "Nano" KEY_LEVEL = "Level" KEY_LOGGER = "Logger" KEY_MSG = "Msg" )
Define string used as keys.
const ( // Login AUDIT_LOGIN_SUCCEED = "1" AUDIT_LOGIN_FAILED = "2" AUDIT_LOGIN_POLICY_DENIAL = "3" AUDIT_INVALID_JWT = "4" AUDIT_LOCK_USER = "5" // Tree events AUDIT_NODE_CREATE = "11" AUDIT_NODE_READ = "12" AUDIT_NODE_LIST = "13" AUDIT_NODE_UPDATE = "14" AUDIT_NODE_DELETE = "15" AUDIT_WS_CREATE = "16" AUDIT_WS_UPDATE = "17" AUDIT_WS_DELETE = "18" AUDIT_NODE_MOVED_TO_BIN = "19" // S3 Objects AUDIT_OBJECT_GET = "21" AUDIT_OBJECT_PUT = "22" // Users, Group, Roles AUDIT_USER_CREATE = "41" AUDIT_USER_READ = "42" AUDIT_USER_UPDATE = "43" AUDIT_USER_DELETE = "44" AUDIT_GROUP_CREATE = "46" AUDIT_GROUP_READ = "47" AUDIT_GROUP_UPDATE = "48" AUDIT_GROUP_DELETE = "49" AUDIT_ROLE_CREATE = "51" AUDIT_ROLE_READ = "52" AUDIT_ROLE_UPDATE = "53" AUDIT_ROLE_DELETE = "54" // Policies AUDIT_POLICY_GROUP_STORE = "61" AUDIT_POLICY_GROUP_DELETE = "62" AUDIT_POLICY_STORE = "63" AUDIT_POLICY_DELETE = "64" // ShareLinks And Cells AUDIT_CELL_CREATE = "71" AUDIT_CELL_READ = "72" AUDIT_CELL_UPDATE = "73" AUDIT_CELL_DELETE = "74" AUDIT_LINK_CREATE = "75" AUDIT_LINK_READ = "76" AUDIT_LINK_UPDATE = "77" AUDIT_LINK_DELETE = "78" )
Known audit message IDs
const ( KEY_CONTEXT = "Context" // Follow a given request between the various services KEY_SPAN_UUID = "SpanUuid" KEY_SPAN_PARENT_UUID = "SpanParentUuid" KEY_SPAN_ROOT_UUID = "SpanRootUuid" // Group messages for a given high level operation KEY_OPERATION_UUID = "OperationUuid" KEY_OPERATION_LABEL = "OperationLabel" KEY_NODE = "Node" KEY_NODE_UUID = "NodeUuid" KEY_NODE_PATH = "NodePath" KEY_WORKSPACE = "Workspace" KEY_WORKSPACE_UUID = "WorkspaceUuid" KEY_WORKSPACE_SCOPE = "WorkspaceScope" KEY_CHANGE_LOG = "ChangeLog" KEY_NODE_CHANGE_EVENT = "NodeChangeEvent" KEY_VERSIONING_POLICY = "VersioningPolicy" KEY_ACTIVITY_SUBSCRIPTION = "ActivitySubscription" KEY_ACTIVITY_STREAM_REQUEST = "StreamActivitiesRequest" KEY_ACTIVITY_POST_EVENT = "PostActivityEvent" KEY_ACTIVITY_OBJECT = "ActivityObject" KEY_ROLE = "Role" KEY_ROLE_UUID = "RoleUuid" KEY_ROLES = "Roles" KEY_PROFILE = "Profile" KEY_USER = "User" KEY_USERNAME = "UserName" KEY_USER_UUID = "UserUuid" KEY_GROUP_PATH = "GroupPath" KEY_CONNECTOR = "Connector" // Should be ACL and ACLID if we use proto names, changed to stay homogeneous with the other fields KEY_ACL = "Acl" KEY_ACL_ID = "AclId" // Pydio internal merged representation of all ACLs that a user has access to KEY_ACCESS_LIST = "AccessList" KEY_POLICY_GROUP = "PolicyGroup" KEY_POLICY_GROUP_UUID = "PolicyGroupUuid" KEY_POLICY = "Policy" KEY_POLICY_ID = "PolicyId" KEY_POLICY_REQUEST = "PolicyRequest" // Scheduler KEY_JOB = "Job" KEY_JOB_ID = "JobId" KEY_ACTION = "Action" KEY_ACTION_ID = "ActionId" KEY_TASK = "Task" KEY_TASK_ID = "TaskId" // Running tasks in scheduler KEY_SCHEDULER_JOB_ID = "SchedulerJobUuid" KEY_SCHEDULER_TASK_ID = "SchedulerTaskUuid" KEY_SCHEDULER_ACTION_PATH = "SchedulerTaskActionPath" // Cells KEY_CELL = "Cell" KEY_CELL_UUID = "CellUuid" KEY_LINK = "ShareLink" KEY_LINK_UUID = "ShareLinkUuid" // Chat KEY_CHAT_ROOM = "ChatRoom" KEY_CHAT_LIST_ROOM_REQ = "ChatListRoomRequest" KEY_CHAT_LIST_MSG_REQ = "ChatListMsgRequest" KEY_CHAT_POST_MSG_REQ = "ChatPostMsgRequest" )
Known audit message IDs
const ( KEY_FRONT_IP = "FrontIp" KEY_FRONT_USERID = "UserId" KEY_FRONT_WKSID = "WorkspaceId" KEY_FRONT_SOURCE = "Source" KEY_FRONT_PREFIX = "Prefix" KEY_FRONT_MESSAGE = "Message" KEY_FRONT_NODES = "Nodes" )
Keys for the front end
Variables ¶
var ( BuildStamp string BuildRevision string )
Main code information. Set by the go linker in the resulting binary when doing 'make main'
var ( PackageType string PackageLabel string )
Package info. Initialised by main.
var ( UpdateDefaultChannel = "stable" UpdateDefaultServerUrl = "https://updatecells.pydio.com/" UpdateDefaultPublicKey = `` /* 424-byte string literal not displayed */ )
Update Server default values.
var ( LogConfig LogConfigType LogLevel zapcore.Level LogCaptureStdOut bool )
Logging Levels.
var ( LogEventLabels = map[string]string{ AUDIT_LOGIN_SUCCEED: "Login succeed", AUDIT_LOGIN_FAILED: "Login failed", AUDIT_NODE_CREATE: "Create Node", AUDIT_NODE_READ: "Read Node", AUDIT_NODE_LIST: "List Node", AUDIT_NODE_UPDATE: "Upadate Node", AUDIT_NODE_DELETE: "Delete Node", AUDIT_OBJECT_GET: "Get Object", AUDIT_OBJECT_PUT: "Put Object", } )
var ( // PydioUserProfiles order reflects the level of authorizations PydioUserProfiles = []string{ PydioProfileAnon, PydioProfileShared, PydioProfileStandard, PydioProfileAdmin, } )
var ( XSpecialPydioHeaders = []string{ XPydioClientUuid, XPydioSessionUuid, XPydioIndexationSessionUuid, XPydioFrontendSessionUuid, XPydioMoveUuid, } )
Functions ¶
func Version ¶
func Version() *hashiversion.Version
Version returns the current code version as an object.
Types ¶
type LogConfigType ¶
type LogConfigType string
Various custom types internally used by Pydio.
const ( LogConfigConsole LogConfigType = "console" LogConfigProduction LogConfigType = "production" )
Define constants for Loggging configuration
type Manager ¶
type Manager interface { Get(string) interface{} Set(string, interface{}) error Del(string) error Map(string) map[string]interface{} }
Manager interface
type XMLSerializableForm ¶ added in v1.2.2
type XMLSerializableForm interface {
Serialize(languages ...string) interface{}
}
Directories ¶
Path | Synopsis |
---|---|
Package auth provides tools related to authentication of pydio services
|
Package auth provides tools related to authentication of pydio services |
claim
Package claim wraps the JWT claims with util functions
|
Package claim wraps the JWT claims with util functions |
Package BoltDB provides tools for using Bolt as a standard persistence layer for services
|
Package BoltDB provides tools for using Bolt as a standard persistence layer for services |
Package config provides tools for managing configurations
|
Package config provides tools for managing configurations |
micro/envvar
Package envvar implements Pydio specific interface for dynamic configurations that are backed by OS environment variables.
|
Package envvar implements Pydio specific interface for dynamic configurations that are backed by OS environment variables. |
micro/remote
Package source implements a configuration client backed by a config server
|
Package source implements a configuration client backed by a config server |
Package crypto provides tools for data encryption and certificates management
|
Package crypto provides tools for data encryption and certificates management |
Package dao provides abstraction of persistence layer used by pydio services.
|
Package dao provides abstraction of persistence layer used by pydio services. |
Package event wraps protobuf events to add context information
|
Package event wraps protobuf events to add context information |
Package forms provides utility methods to generate XML that is interpreted by the Front End to build forms.
|
Package forms provides utility methods to generate XML that is interpreted by the Front End to build forms. |
Package log define and configure the Pydio loggers based on zap.
|
Package log define and configure the Pydio loggers based on zap. |
Package defaults initializes the defaults GRPC clients and servers used by services
|
Package defaults initializes the defaults GRPC clients and servers used by services |
client/grpc
Package grpc provides a gRPC client Package grpc provides a gRPC options
|
Package grpc provides a gRPC client Package grpc provides a gRPC options |
router
Package router provides api service routing
|
Package router provides api service routing |
selector/cache
Package cache is a caching selector.
|
Package cache is a caching selector. |
server/grpc
Package grpc provides a grpc server
|
Package grpc provides a grpc server |
server/http
Package http implements a go-micro.Server
|
Package http implements a go-micro.Server |
Package mocks should provide utils used by tests to mock various layers.
|
Package mocks should provide utils used by tests to mock various layers. |
## Protobuf Definitions This folder contains all Protobufs used by services to communicate
|
## Protobuf Definitions This folder contains all Protobufs used by services to communicate |
activity
Package activity is a generated protocol buffer package.
|
Package activity is a generated protocol buffer package. |
auth
Package auth is a generated protocol buffer package.
|
Package auth is a generated protocol buffer package. |
chat
Package chat is a generated protocol buffer package.
|
Package chat is a generated protocol buffer package. |
ctl
Package ctl is a generated protocol buffer package.
|
Package ctl is a generated protocol buffer package. |
docstore
Package docstore is a generated protocol buffer package.
|
Package docstore is a generated protocol buffer package. |
encryption
Package encryption is a generated protocol buffer package.
|
Package encryption is a generated protocol buffer package. |
front
Package front is a generated protocol buffer package.
|
Package front is a generated protocol buffer package. |
idm
Package idm is a generated protocol buffer package.
|
Package idm is a generated protocol buffer package. |
install
Package install is a generated protocol buffer package.
|
Package install is a generated protocol buffer package. |
jobs
Package jobs is a generated protocol buffer package.
|
Package jobs is a generated protocol buffer package. |
log
Package log is a generated protocol buffer package.
|
Package log is a generated protocol buffer package. |
mailer
Package mailer is a generated protocol buffer package.
|
Package mailer is a generated protocol buffer package. |
object
Package object is a generated protocol buffer package.
|
Package object is a generated protocol buffer package. |
rest
Package rest is a generated protocol buffer package.
|
Package rest is a generated protocol buffer package. |
rest/cmd
Package cmd provides a specific tool for transforming json swagger file into a go file
|
Package cmd provides a specific tool for transforming json swagger file into a go file |
sync
Package sync is a generated protocol buffer package.
|
Package sync is a generated protocol buffer package. |
test
Package test is a generated protocol buffer package.
|
Package test is a generated protocol buffer package. |
tree
Package tree is a generated protocol buffer package.
|
Package tree is a generated protocol buffer package. |
update
Package update is a generated protocol buffer package.
|
Package update is a generated protocol buffer package. |
Package registry provides the main glue between services It wraps micro registry (running services declared to the discovery server) into a more generic registry where all actual plugins are self-declared.
|
Package registry provides the main glue between services It wraps micro registry (running services declared to the discovery server) into a more generic registry where all actual plugins are self-declared. |
Package service acts as a factory for all Pydio services.
|
Package service acts as a factory for all Pydio services. |
context
Package servicecontext performs context values read/write, generally through server or client wrappers
|
Package servicecontext performs context values read/write, generally through server or client wrappers |
frontend
Package frontend provides tools to publish static data from within any micro service It implements a simple Union HttpFS to be exposed by a standard net.HttpFileServer interface.
|
Package frontend provides tools to publish static data from within any micro service It implements a simple Union HttpFS to be exposed by a standard net.HttpFileServer interface. |
proto
Package service is a generated protocol buffer package.
|
Package service is a generated protocol buffer package. |
resources
Package resources provides extendable service Handler for managing resource-policy based data.
|
Package resources provides extendable service Handler for managing resource-policy based data. |
Package sql provides tools and DAOs for speaking SQL as well as managing tables migrations
|
Package sql provides tools and DAOs for speaking SQL as well as managing tables migrations |
index
Package index provides ready-to-use tables and DAOs for storing hierarchical data using the nested sets pattern * Copyright (c) 2018.
|
Package index provides ready-to-use tables and DAOs for storing hierarchical data using the nested sets pattern * Copyright (c) 2018. |
resources
Package resources provides ready-to-use SQL schemes and DAOs for attaching resource policies to any data
|
Package resources provides ready-to-use SQL schemes and DAOs for attaching resource policies to any data |
sync
|
|
endpoints/cells
Package cells provides endpoints for speaking either with a local server using a views.Router (and connecting to the local NATS registry), or a remote Cells server using a GRPC gateway client.
|
Package cells provides endpoints for speaking either with a local server using a views.Router (and connecting to the local NATS registry), or a remote Cells server using a GRPC gateway client. |
endpoints/filesystem
Package file system provides endpoints for reading/writing from/to a local folder
|
Package file system provides endpoints for reading/writing from/to a local folder |
endpoints/index
Package index provides a GRPC client for storing information into any tree.NodeProviderClient/tree.NodeReceiverClient service.
|
Package index provides a GRPC client for storing information into any tree.NodeProviderClient/tree.NodeReceiverClient service. |
endpoints/memory
Package memory provides an in-memory basic implementation of an Endpoint, with nodes stored in a map.
|
Package memory provides an in-memory basic implementation of an Endpoint, with nodes stored in a map. |
endpoints/s3
Package s3 provides an endpoint for connecting to Amazon S3 or an S3-compatible storage
|
Package s3 provides an endpoint for connecting to Amazon S3 or an S3-compatible storage |
endpoints/snapshot
Package snapshot provides fast in-memory or on-file implementations of endpoint for storing snapshots
|
Package snapshot provides fast in-memory or on-file implementations of endpoint for storing snapshots |
filters
Package filters provides batchers and filters to analyze and simplify sync events
|
Package filters provides batchers and filters to analyze and simplify sync events |
merger
Package merger implements all logic to compare trees and create set of operations to be applied
|
Package merger implements all logic to compare trees and create set of operations to be applied |
model
Package model gathers the main structs and interfaces used in sync library.
|
Package model gathers the main structs and interfaces used in sync library. |
proc
Package proc provides actual actions to be performed once the sync has filtered all events
|
Package proc provides actual actions to be performed once the sync has filtered all events |
task
Package task defines a synchronization task
|
Package task defines a synchronization task |
Package utils provides swiss-knife tools for all services
|
Package utils provides swiss-knife tools for all services |
cache
Package cache provides ready-to-use in-memory cache mechanisms
|
Package cache provides ready-to-use in-memory cache mechanisms |
context
Package context manipulates context metadata
|
Package context manipulates context metadata |
error
Package error creates and parses common errors
|
Package error creates and parses common errors |
i18n
Package i18n wraps go-i18n lib for manipulating bundles
|
Package i18n wraps go-i18n lib for manipulating bundles |
meta
Package meta provides tool for reading metadata from services declaring "MetaProvider" support
|
Package meta provides tool for reading metadata from services declaring "MetaProvider" support |
mtree
Package mtree provides advanced tools for encoding tree paths in a material format
|
Package mtree provides advanced tools for encoding tree paths in a material format |
net
Package net provides tools for reading IPs, available Ports, extending HTTP requests, etc.
|
Package net provides tools for reading IPs, available Ports, extending HTTP requests, etc. |
permissions
Package permissions provides high-level tools for computing permissions from ACLs
|
Package permissions provides high-level tools for computing permissions from ACLs |
schedule
Package schedule provides a fixed ticker based on a start time iso8601 interval periods are supported
|
Package schedule provides a fixed ticker based on a start time iso8601 interval periods are supported |
std
Package std provides tools for standard types (strings, int, floats, etc).
|
Package std provides tools for standard types (strings, int, floats, etc). |
Package views provides high-level clients for talking to the main data tree in certain context.
|
Package views provides high-level clients for talking to the main data tree in certain context. |