Documentation ¶
Index ¶
- Constants
- Variables
- func CreateLink(ctx context.Context, be blenc.BE, ep *protobuf.Entrypoint) (*protobuf.Entrypoint, *protobuf.WriterInfo, error)
- func DereferenceLink(ctx context.Context, be blenc.BE, link *protobuf.Entrypoint, maxRedirects int, ...) (*protobuf.Entrypoint, error)
- func UpdateLink(ctx context.Context, be blenc.BE, wi *protobuf.WriterInfo, ...) (*protobuf.Entrypoint, error)
- func UploadStaticBlob(ctx context.Context, be blenc.BE, r io.Reader, mimeType string, ...) (*protobuf.Entrypoint, error)
- func UploadStaticDirectory(ctx context.Context, log *slog.Logger, fsys fs.FS, be blenc.BE) (*protobuf.Entrypoint, error)
- type CinodeFS
- type HTTPHandler
- type StaticDir
Constants ¶
View Source
const (
CinodeDirMimeType = "application/cinode-dir"
)
Variables ¶
View Source
var ( ErrNotFound = blenc.ErrNotFound ErrNotADirectory = errors.New("entry is not a directory") ErrNotAFile = errors.New("entry is not a file") )
View Source
var ( ErrMaxRedirectsReached = errors.New("maximum limit of dynamic link redirects reached") ErrCorruptedLinkData = errors.New("corrupted link data") ErrCorruptedDirectoryData = errors.New("corrupted directory data") ErrInvalidEntrypoint = protobuf.ErrInvalidEntrypoint ErrInvalidEntrypointTime = protobuf.ErrInvalidEntrypointTime )
Functions ¶
func CreateLink ¶
func CreateLink(ctx context.Context, be blenc.BE, ep *protobuf.Entrypoint) (*protobuf.Entrypoint, *protobuf.WriterInfo, error)
func DereferenceLink ¶
func UpdateLink ¶
func UpdateLink(ctx context.Context, be blenc.BE, wi *protobuf.WriterInfo, ep *protobuf.Entrypoint) (*protobuf.Entrypoint, error)
func UploadStaticBlob ¶ added in v0.0.6
func UploadStaticBlob(ctx context.Context, be blenc.BE, r io.Reader, mimeType string, log *slog.Logger) (*protobuf.Entrypoint, error)
UploadStaticBlob uploads blob to the associated datastore and returns entrypoint to that file
if mimeType is an empty string, it will be guessed from the content defaulting to
Types ¶
type CinodeFS ¶
type CinodeFS struct { BE blenc.BE RootEntrypoint *protobuf.Entrypoint MaxLinkRedirects int CurrentTimeF func() time.Time }
func (*CinodeFS) FindEntrypoint ¶
func (*CinodeFS) OpenContent ¶
func (d *CinodeFS) OpenContent(ctx context.Context, ep *protobuf.Entrypoint) (io.ReadCloser, error)
type HTTPHandler ¶ added in v0.0.2
func (*HTTPHandler) ServeHTTP ¶ added in v0.0.2
func (h *HTTPHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type StaticDir ¶ added in v0.0.6
type StaticDir struct {
// contains filtered or unexported fields
}
func (*StaticDir) GenerateEntrypoint ¶ added in v0.0.6
func (*StaticDir) GenerateIndex ¶ added in v0.0.6
Click to show internal directories.
Click to hide internal directories.