Documentation ¶
Overview ¶
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.
Index ¶
- Variables
- type Abstract
- func (c *Abstract) ComputeChecksum(node *tree.Node) error
- func (c *Abstract) CreateNode(ctx context.Context, node *tree.Node, updateIfExists bool) (err error)
- func (c *Abstract) DeleteNode(ctx context.Context, name string) (err error)
- func (c *Abstract) GetCachedBranches(ctx context.Context, roots ...string) model.PathSyncSource
- func (c *Abstract) GetReaderOn(p string) (out io.ReadCloser, err error)
- func (c *Abstract) GetWriterOn(cancel context.Context, p string, targetSize int64) (out io.WriteCloser, writeDone chan bool, writeErr chan error, err error)
- func (c *Abstract) LoadNode(ctx context.Context, path string, extendedStats ...bool) (node *tree.Node, err error)
- func (c *Abstract) MoveNode(ct context.Context, oldPath string, newPath string) (err error)
- func (c *Abstract) PatchUpdateSnapshot(ctx context.Context, patch interface{})
- func (c *Abstract) SetUpdateSnapshot(target model.PathSyncTarget)
- func (c *Abstract) Walk(walknFc model.WalkNodesFunc, root string, recursive bool) (err error)
- func (c *Abstract) Watch(recursivePath string) (*model.WatchObject, error)
- type DynamicRegistry
- type NoopWriter
- type ObjectsClient
- type Options
- type RegistryRefreshClient
- func (r *RegistryRefreshClient) Call(ctx context.Context, req client.Request, rsp interface{}, ...) error
- func (r *RegistryRefreshClient) CallRemote(ctx context.Context, addr string, req client.Request, rsp interface{}, ...) error
- func (r *RegistryRefreshClient) Init(o ...client.Option) error
- func (r *RegistryRefreshClient) NewJsonRequest(service, method string, req interface{}, reqOpts ...client.RequestOption) client.Request
- func (r *RegistryRefreshClient) NewProtoRequest(service, method string, req interface{}, reqOpts ...client.RequestOption) client.Request
- func (r *RegistryRefreshClient) NewPublication(topic string, msg interface{}) client.Publication
- func (r *RegistryRefreshClient) NewRequest(service, method string, req interface{}, reqOpts ...client.RequestOption) client.Request
- func (r *RegistryRefreshClient) Options() client.Options
- func (r *RegistryRefreshClient) Publish(ctx context.Context, p client.Publication, opts ...client.PublishOption) error
- func (r *RegistryRefreshClient) Stream(ctx context.Context, req client.Request, opts ...client.CallOption) (client.Streamer, error)
- func (r *RegistryRefreshClient) StreamRemote(ctx context.Context, addr string, req client.Request, ...) (client.Streamer, error)
- func (r *RegistryRefreshClient) String() string
- type Remote
- func (c *Remote) BulkLoadNodes(ctx context.Context, nodes map[string]string) (map[string]interface{}, error)
- func (c *Remote) CreateNode(ctx context.Context, node *tree.Node, updateIfExists bool) (err error)
- func (c *Remote) FinishSession(ctx context.Context, sessionUuid string) error
- func (c *Remote) FlushSession(ctx context.Context, sessionUuid string) error
- func (c *Remote) GetEndpointInfo() model.EndpointInfo
- func (c *Remote) RefreshRemoteConfig(config RemoteConfig)
- func (c *Remote) StartSession(ctx context.Context, rootNode *tree.Node, silent bool) (*tree.IndexationSession, error)
- type RemoteConfig
Constants ¶
This section is empty.
Variables ¶
var (
RemoteCellsServiceName = "pydio.gateway.grpc"
)
Functions ¶
This section is empty.
Types ¶
type Abstract ¶
type Abstract struct { sync.Mutex Factory clientProviderFactory Source model.PathSyncSource ClientUUID string Root string Options Options RecentMkDirs []*tree.Node GlobalCtx context.Context // contains filtered or unexported fields }
func (*Abstract) ComputeChecksum ¶
ComputeChecksum is not implemented
func (*Abstract) CreateNode ¶
func (c *Abstract) CreateNode(ctx context.Context, node *tree.Node, updateIfExists bool) (err error)
CreateNode is used for creating folders only
func (*Abstract) DeleteNode ¶
DeleteNode forwards call to the grpc gateway. For folders, the recursive deletion will happen on the gateway side. It may take some time, thus a request timeout of 5 minutes.
func (*Abstract) GetCachedBranches ¶
GetCachedBranches implements CachedBranchProvider by loading branches in a MemDB
func (*Abstract) GetReaderOn ¶
func (c *Abstract) GetReaderOn(p string) (out io.ReadCloser, err error)
GetReaderOn retrieves an io.ReadCloser from the S3 Get operation
func (*Abstract) GetWriterOn ¶
func (c *Abstract) GetWriterOn(cancel context.Context, p string, targetSize int64) (out io.WriteCloser, writeDone chan bool, writeErr chan error, err error)
GetWriterOn retrieves a WriteCloser wired to the S3 gateway to PUT a file.
func (*Abstract) LoadNode ¶
func (c *Abstract) LoadNode(ctx context.Context, path string, extendedStats ...bool) (node *tree.Node, err error)
LoadNode forwards call to cli.ReadNode
func (*Abstract) MoveNode ¶
MoveNode renames a file or folder and *blocks* until the node has been properly moved (sync)
func (*Abstract) PatchUpdateSnapshot ¶
PatchUpdateSnapshot does nothing
func (*Abstract) SetUpdateSnapshot ¶
func (c *Abstract) SetUpdateSnapshot(target model.PathSyncTarget)
SetUpdateSnapshot registers a snapshot to be updated when events are received from server
type DynamicRegistry ¶
DynamicRegistry is an implementation of a Micro Registry that automatically detect the target GRPC port from the discovery endpoint of the target server.
func NewDynamicRegistry ¶
func NewDynamicRegistry(config *transport.SdkConfig) *DynamicRegistry
NewDynamicRegistry creates a new DynamicRegistry from a standard SdkConfig
func (*DynamicRegistry) Refresh ¶
func (d *DynamicRegistry) Refresh() error
Refresh deregisters all services and tries to detect service
type NoopWriter ¶
type NoopWriter struct{}
NoopWriter is a simple writer for ignoring contents
func (*NoopWriter) Close ¶
func (nw *NoopWriter) Close() error
type ObjectsClient ¶
type ObjectsClient interface { GetObject(ctx context.Context, node *tree.Node, requestData *models.GetRequestData) (io.ReadCloser, error) PutObject(ctx context.Context, node *tree.Node, reader io.Reader, requestData *models.PutRequestData) (int64, error) CopyObject(ctx context.Context, from *tree.Node, to *tree.Node, requestData *models.CopyRequestData) (int64, error) }
type Options ¶
type Options struct { model.EndpointOptions // If router is started in an independent process, call basic initialization to connect to registry. LocalInitRegistry bool // If a sync is connecting two endpoint of a same server, we have to make sure to avoid Uuid collision RenewFolderUuids bool }
type RegistryRefreshClient ¶
type RegistryRefreshClient struct {
// contains filtered or unexported fields
}
RegistryRefreshClient is an implementation of a Micro Client that tries to refresh the registry if a streamer connection is broken (GRPC port may change across server restart).
func (*RegistryRefreshClient) Call ¶
func (r *RegistryRefreshClient) Call(ctx context.Context, req client.Request, rsp interface{}, opts ...client.CallOption) error
func (*RegistryRefreshClient) CallRemote ¶
func (r *RegistryRefreshClient) CallRemote(ctx context.Context, addr string, req client.Request, rsp interface{}, opts ...client.CallOption) error
func (*RegistryRefreshClient) NewJsonRequest ¶
func (r *RegistryRefreshClient) NewJsonRequest(service, method string, req interface{}, reqOpts ...client.RequestOption) client.Request
func (*RegistryRefreshClient) NewProtoRequest ¶
func (r *RegistryRefreshClient) NewProtoRequest(service, method string, req interface{}, reqOpts ...client.RequestOption) client.Request
func (*RegistryRefreshClient) NewPublication ¶
func (r *RegistryRefreshClient) NewPublication(topic string, msg interface{}) client.Publication
func (*RegistryRefreshClient) NewRequest ¶
func (r *RegistryRefreshClient) NewRequest(service, method string, req interface{}, reqOpts ...client.RequestOption) client.Request
func (*RegistryRefreshClient) Options ¶
func (r *RegistryRefreshClient) Options() client.Options
func (*RegistryRefreshClient) Publish ¶
func (r *RegistryRefreshClient) Publish(ctx context.Context, p client.Publication, opts ...client.PublishOption) error
func (*RegistryRefreshClient) Stream ¶
func (r *RegistryRefreshClient) Stream(ctx context.Context, req client.Request, opts ...client.CallOption) (client.Streamer, error)
func (*RegistryRefreshClient) StreamRemote ¶
func (*RegistryRefreshClient) String ¶
func (r *RegistryRefreshClient) String() string
type Remote ¶
type Remote struct { Abstract // contains filtered or unexported fields }
Remote connect to a remove Cells server using the GRPC gateway.
func NewRemote ¶
func NewRemote(config RemoteConfig, root string, options Options) *Remote
NewRemote creates a new Remote Endpoint
func (*Remote) BulkLoadNodes ¶
func (c *Remote) BulkLoadNodes(ctx context.Context, nodes map[string]string) (map[string]interface{}, error)
BulkLoadNodes streams ReadNode requests from server
func (*Remote) CreateNode ¶
CreateNode creates folder, eventually resetting their UUID if the options RenewFolderUuids is set. If an indexation session is started, it stacks all Creates in memory and perform them only at Flush.
func (*Remote) FinishSession ¶
FinishSession flushes the session and closes it.
func (*Remote) FlushSession ¶
FlushSession sends all creates as a stream to the target server
func (*Remote) GetEndpointInfo ¶
func (c *Remote) GetEndpointInfo() model.EndpointInfo
GetEndpointInfo returns Endpoint information in standard format.
func (*Remote) RefreshRemoteConfig ¶
func (c *Remote) RefreshRemoteConfig(config RemoteConfig)
RefreshRemoteConfig is used to refresh ID Token / Refresh Token from outside
type RemoteConfig ¶
type RemoteConfig struct { // Url stores domain name or IP & port to the server. Url string `json:"url"` // OIDC GrantPassword Flow ClientKey string `json:"clientKey"` ClientSecret string `json:"clientSecret"` User string `json:"user"` Password string `json:"password"` // OIDC Code Flow IdToken string `json:"id_token"` RefreshToken string `json:"refresh_token"` ExpiresAt int `json:"expires_at"` // SkipVerify tells the transport to ignore expired or self-signed TLS certificates SkipVerify bool `json:"skipVerify"` CustomHeaders map[string]string `json:"-"` }
RemoteConfig is a dependency-free struct similar to SdkConfig