share

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

App of package

func New

func New(config Config, storageApp provider.Storage, amqpClient *amqp.Client) (*App, error)

New creates new App from Config

func (*App) AmqpHandler added in v0.11.0

func (a *App) AmqpHandler(message amqp.Delivery) error

AmqpHandler handle exif message

func (*App) Create

func (a *App) Create(filepath string, edit bool, password string, isDir bool, duration time.Duration) (string, error)

Create a share

func (*App) Delete

func (a *App) Delete(id string) error

Delete a share

func (*App) Enabled

func (a *App) Enabled() bool

Enabled checks if requirements are met

func (*App) EventConsumer added in v0.8.0

func (a *App) EventConsumer(e provider.Event)

EventConsumer handle event pushed to the event bus

func (*App) Exclusive added in v0.11.0

func (a *App) Exclusive(ctx context.Context, name string, duration time.Duration, action func(ctx context.Context) error) (bool, error)

Exclusive does action on shares with exclusive lock

func (*App) Get

func (a *App) Get(requestPath string) provider.Share

Get returns a share based on path

func (*App) List

func (a *App) List() map[string]provider.Share

List shares

func (*App) Start

func (a *App) Start(done <-chan struct{})

Start worker

type Config

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

Config of package

func Flags

func Flags(fs *flag.FlagSet, prefix string) Config

Flags adds flags for configuring package

Jump to

Keyboard shortcuts

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