storage

package module
v0.0.0-...-4c13854 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: Apache-2.0 Imports: 43 Imported by: 2

README

Storage

A GORM-style storage wrapper with unified API for different cloud storage backends

Documentation

Overview

Copyright 2025 LiveKit, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AliOSSConfig

type AliOSSConfig = config.AliOSSConfig

The config structs live in the storage/config package so that consumers which only embed them in their own config (and never create a Storage) don't pull in every provider SDK. These aliases keep the existing API.

type AzureConfig

type AzureConfig = config.AzureConfig

The config structs live in the storage/config package so that consumers which only embed them in their own config (and never create a Storage) don't pull in every provider SDK. These aliases keep the existing API.

type Config

type Config = config.Config

The config structs live in the storage/config package so that consumers which only embed them in their own config (and never create a Storage) don't pull in every provider SDK. These aliases keep the existing API.

type ErrorWithStatusCode

type ErrorWithStatusCode struct {
	Err        error
	StatusCode int
}

func (*ErrorWithStatusCode) Error

func (e *ErrorWithStatusCode) Error() string

func (*ErrorWithStatusCode) Unwrap

func (e *ErrorWithStatusCode) Unwrap() error

type GCPConfig

type GCPConfig = config.GCPConfig

The config structs live in the storage/config package so that consumers which only embed them in their own config (and never create a Storage) don't pull in every provider SDK. These aliases keep the existing API.

type LocalConfig

type LocalConfig = config.LocalConfig

The config structs live in the storage/config package so that consumers which only embed them in their own config (and never create a Storage) don't pull in every provider SDK. These aliases keep the existing API.

type OCIConfig

type OCIConfig = config.OCIConfig

The config structs live in the storage/config package so that consumers which only embed them in their own config (and never create a Storage) don't pull in every provider SDK. These aliases keep the existing API.

type ProxyConfig

type ProxyConfig = config.ProxyConfig

The config structs live in the storage/config package so that consumers which only embed them in their own config (and never create a Storage) don't pull in every provider SDK. These aliases keep the existing API.

type S3Config

type S3Config = config.S3Config

The config structs live in the storage/config package so that consumers which only embed them in their own config (and never create a Storage) don't pull in every provider SDK. These aliases keep the existing API.

type S3Logger

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

S3Logger only logs aws messages on upload failure

func NewS3Logger

func NewS3Logger() *S3Logger

func (*S3Logger) Logf

func (l *S3Logger) Logf(classification logging.Classification, format string, v ...interface{})

func (*S3Logger) WriteLogs

func (l *S3Logger) WriteLogs()

type Storage

type Storage interface {
	UploadData(data []byte, storagePath, contentType string) (location string, size int64, err error)
	UploadFile(filepath, storagePath, contentType string) (location string, size int64, err error)

	ListObjects(prefix string) ([]string, error)

	DownloadData(storagePath string) (data []byte, err error)
	DownloadFile(filepath, storagePath string) (size int64, err error)

	GeneratePresignedUrl(storagePath string, expiration time.Duration) (url string, err error)

	DeleteObject(storagePath string) error
	DeleteObjects(storagePaths []string) error
}

func New

func New(conf Config) (Storage, error)

func NewAliOSS

func NewAliOSS(conf *AliOSSConfig) (Storage, error)

func NewAzure

func NewAzure(conf *AzureConfig) (Storage, error)

func NewGCP

func NewGCP(conf *GCPConfig) (Storage, error)

func NewLocal

func NewLocal(conf *LocalConfig) (Storage, error)

func NewOCI

func NewOCI(conf *OCIConfig) (Storage, error)

func NewS3

func NewS3(conf *S3Config) (Storage, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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