imgsource

package
v1.1.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TokenTransportHeader holds the header key for the reva transfer token
	// "github.com/opencloud-eu/reva/v2/internal/http/services/datagateway" is internal so we redeclare it here
	TokenTransportHeader = "X-Reva-Transfer"
)

Variables

This section is empty.

Functions

func ContextGetAuthorization

func ContextGetAuthorization(ctx context.Context) (string, bool)

ContextGetAuthorization gets the authorization from the context.

func ContextSetAuthorization

func ContextSetAuthorization(parent context.Context, authorization string) context.Context

ContextSetAuthorization puts the authorization in the context.

Types

type CS3

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

CS3 implements a CS3 image source

func NewCS3Source

func NewCS3Source(cfg config.Thumbnail, gatewaySelector pool.Selectable[gateway.GatewayAPIClient], b bytesize.ByteSize) CS3

NewCS3Source configures a new CS3 image source

func (CS3) Get

func (s CS3) Get(ctx context.Context, path string) (io.ReadCloser, error)

Get downloads the file from a cs3 service The caller MUST make sure to close the returned ReadCloser

type Source

type Source interface {
	Get(ctx context.Context, path string) (io.ReadCloser, error)
}

Source defines the interface for image sources

type WebDav

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

WebDav implements the Source interface for webdav services

func NewWebDavSource

func NewWebDavSource(cfg config.Thumbnail, b bytesize.ByteSize) WebDav

NewWebDavSource creates a new webdav instance.

func (WebDav) Get

func (s WebDav) Get(ctx context.Context, url string) (io.ReadCloser, error)

Get downloads the file from a webdav service The caller MUST make sure to close the returned ReadCloser

Jump to

Keyboard shortcuts

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