v1

package
v0.0.0-...-03ee3a8 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2025 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Options)

Option update function

func WithEventstream

func WithEventstream(eventStream nc.Publisher) Option

WithEventstream cannel option

func WithRetries

func WithRetries(maxRetries int) Option

WithRetries count of attempts

func WithStageProcessingLimit

func WithStageProcessingLimit(limit int) Option

WithStageProcessingLimit custom option

func WithStorage

func WithStorage(store *storage.Storage) Option

WithStorage custom option

func WithStorageConverters

func WithStorageConverters(convs []converters.Converter) Option

WithStorageConverters custom option

func WithTaskProcessingLimit

func WithTaskProcessingLimit(limit int) Option

WithTaskProcessingLimit custom option

func WithUpdateState

func WithUpdateState(updateState updateStateI) Option

WithUpdateState memory checkpoint option

type Options

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

Options of the server

type ServerHTTPWrapper

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

ServerHTTPWrapper object

func NewHTTPWrapper

func NewHTTPWrapper(s any) *ServerHTTPWrapper

NewHTTPWrapper returns HTTP wrapper

func (ServerHTTPWrapper) Delete

func (s ServerHTTPWrapper) Delete(ctx context.Context, obj *protocol.ObjectIDNames) (_ *protocol.SimpleResponse, err error)

Delete object or subobjects

func (ServerHTTPWrapper) Get

func (s ServerHTTPWrapper) Get(obj *protocol.ObjectID, stream protocol.ServiceAPI_GetServer) error

Get object with content by stream

func (*ServerHTTPWrapper) GetHTTPHandler

func (s *ServerHTTPWrapper) GetHTTPHandler(w http.ResponseWriter, r *http.Request)

GetHTTPHandler defined HTTP object read handler

func (ServerHTTPWrapper) GetManifest

func (s ServerHTTPWrapper) GetManifest(ctx context.Context, group *protocol.ManifestGroup) (_ *protocol.ManifestResponse, err error)

GetManifest from the group

func (ServerHTTPWrapper) Head

func (s ServerHTTPWrapper) Head(ctx context.Context, obj *protocol.ObjectID) (*protocol.SimpleObjectResponse, error)

Head returns basic meta information from object

func (*ServerHTTPWrapper) HeadHTTPHandler

func (s *ServerHTTPWrapper) HeadHTTPHandler(w http.ResponseWriter, r *http.Request)

HeadHTTPHandler defined HTTP object info handler

func (ServerHTTPWrapper) Receive

func (s ServerHTTPWrapper) Receive(message nc.Message) error

Receive method of stream processing pipeline

func (ServerHTTPWrapper) Refresh

func (s ServerHTTPWrapper) Refresh(ctx context.Context, obj *protocol.ObjectID) (*protocol.SimpleResponse, error)

Refresh pbject processing (recreate thumbs, meta data and etc.)

func (ServerHTTPWrapper) SetManifest

func (s ServerHTTPWrapper) SetManifest(ctx context.Context, manifest *protocol.DataManifest) (_ *protocol.SimpleResponse, err error)

SetManifest of the group which will be applied for entities of the `group` - {storage-domain}/{group}/manifest.json

  • {storage-domain}/{group}/{object-codename}/manifest.json - reference to `{storage-domain}/{group}/manifest.json`

func (ServerHTTPWrapper) Upload

func (s ServerHTTPWrapper) Upload(stream protocol.ServiceAPI_UploadServer) (err error)

Upload new object from the stream

func (*ServerHTTPWrapper) UploadHTTPHandler

func (s *ServerHTTPWrapper) UploadHTTPHandler(w http.ResponseWriter, r *http.Request)

UploadHTTPHandler defined HTTP upload handler query params:

id:string      - custom object ID
overwrite:bool - overwrite with custom object ID

func (ServerHTTPWrapper) UploadObject

func (s ServerHTTPWrapper) UploadObject(ctx context.Context, group, customID string, overwrite bool, tags []string, obj io.Reader) (npio.Object, error)

UploadObject for the specific group of files

type ServiceServer

type ServiceServer interface {
	protocol.ServiceAPIServer

	UploadObject(ctx context.Context, group, customID string,
		overwrite bool, tags []string, obj io.Reader) (npio.Object, error)
}

ServiceServer with functional extension

func NewServer

func NewServer(connect, storageConnect, stateConnect string, opts ...Option) (ServiceServer, error)

NewServer object which implements RPC actions

type UpdateStateFnk

type UpdateStateFnk func(key any) bool

UpdateStateFnk provides wrapper of function as state interface

func (UpdateStateFnk) TryBeginUpdate

func (f UpdateStateFnk) TryBeginUpdate(key any) bool

TryBeginUpdate state update

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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