assets

package
v0.0.0-...-4ae6852 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2025 License: AGPL-3.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxFileSizeFunctions = 15 * mib
	MaxFileSizeOpenAPI   = 10 * mib
	MaxFileSizeImage     = 4 * mib
)

Variables

This section is empty.

Functions

func Attach

func Attach(mux goahttp.Muxer, service *Service)

Types

type BlobStore

type BlobStore interface {
	Exists(ctx context.Context, objectURL *url.URL) (bool, error)
	Read(ctx context.Context, objectURL *url.URL) (rdr io.ReadCloser, err error)
	ReadAt(ctx context.Context, objectURL *url.URL) (rdr ReaderAtCloser, size int64, err error)
	Write(ctx context.Context, urlpath string, src io.Reader, contentType string) (io.WriteCloser, *url.URL, error)
}

type FSBlobStore

type FSBlobStore struct {
	Root   *os.Root
	Logger *slog.Logger
	// contains filtered or unexported fields
}

func NewFSBlobStore

func NewFSBlobStore(logger *slog.Logger, root *os.Root) *FSBlobStore

func (*FSBlobStore) Exists

func (fbs *FSBlobStore) Exists(ctx context.Context, u *url.URL) (bool, error)

func (*FSBlobStore) Read

func (fbs *FSBlobStore) Read(ctx context.Context, u *url.URL) (io.ReadCloser, error)

func (*FSBlobStore) ReadAt

func (fbs *FSBlobStore) ReadAt(ctx context.Context, u *url.URL) (ReaderAtCloser, int64, error)

func (*FSBlobStore) Write

func (fbs *FSBlobStore) Write(ctx context.Context, pathname string, src io.Reader, contentType string) (io.WriteCloser, *url.URL, error)

type GCSBlobStore

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

func NewGCSBlobStore

func NewGCSBlobStore(ctx context.Context, logger *slog.Logger, bucketURI string) (*GCSBlobStore, error)

func (*GCSBlobStore) Exists

func (gbs *GCSBlobStore) Exists(ctx context.Context, u *url.URL) (bool, error)

func (*GCSBlobStore) Read

func (gbs *GCSBlobStore) Read(ctx context.Context, u *url.URL) (io.ReadCloser, error)

func (*GCSBlobStore) ReadAt

func (gbs *GCSBlobStore) ReadAt(ctx context.Context, u *url.URL) (ReaderAtCloser, int64, error)

func (*GCSBlobStore) Write

func (gbs *GCSBlobStore) Write(ctx context.Context, subpath string, src io.Reader, contentType string) (io.WriteCloser, *url.URL, error)

type ReaderAtCloser

type ReaderAtCloser interface {
	io.ReaderAt
	io.Closer
}

type Service

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

func NewService

func NewService(logger *slog.Logger, db *pgxpool.Pool, sessions *sessions.Manager, storage BlobStore) *Service

func (*Service) APIKeyAuth

func (s *Service) APIKeyAuth(ctx context.Context, key string, schema *security.APIKeyScheme) (context.Context, error)

func (*Service) ListAssets

func (s *Service) ListAssets(ctx context.Context, payload *gen.ListAssetsPayload) (*gen.ListAssetsResult, error)

func (*Service) ServeImage

func (s *Service) ServeImage(ctx context.Context, payload *gen.ServeImageForm) (*gen.ServeImageResult, io.ReadCloser, error)

func (*Service) ServeOpenAPIv3

func (s *Service) ServeOpenAPIv3(ctx context.Context, payload *gen.ServeOpenAPIv3Form) (*gen.ServeOpenAPIv3Result, io.ReadCloser, error)

func (*Service) UploadFunctions

func (s *Service) UploadFunctions(ctx context.Context, payload *gen.UploadFunctionsForm, reader io.ReadCloser) (*gen.UploadFunctionsResult, error)

func (*Service) UploadImage

func (s *Service) UploadImage(ctx context.Context, payload *gen.UploadImageForm, reader io.ReadCloser) (res *gen.UploadImageResult, err error)

func (*Service) UploadOpenAPIv3

func (s *Service) UploadOpenAPIv3(ctx context.Context, payload *gen.UploadOpenAPIv3Form, reader io.ReadCloser) (*gen.UploadOpenAPIv3Result, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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