Documentation
¶
Index ¶
- Constants
- type GraphQLQueriesMode
- type Instance
- type LocalDirV1
- func (s *LocalDirV1) BaseURL(catalog string) string
- func (s *LocalDirV1) ContentExists(catalog string) bool
- func (s *LocalDirV1) Delete(catalog string) error
- func (s *LocalDirV1) GetCatalogData(catalog string) (*os.File, os.FileInfo, error)
- func (s *LocalDirV1) GetCatalogFS(catalog string) (fs.FS, error)
- func (s *LocalDirV1) GetIndex(catalog string) (server.Index, error)
- func (s *LocalDirV1) StorageServerHandler() http.Handler
- func (s *LocalDirV1) Store(ctx context.Context, catalog string, fsys fs.FS) error
- type MetasHandlerMode
Constants ¶
const ( MetasHandlerDisabled = server.MetasHandlerDisabled MetasHandlerEnabled = server.MetasHandlerEnabled GraphQLQueriesDisabled = server.GraphQLQueriesDisabled GraphQLQueriesEnabled = server.GraphQLQueriesEnabled )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GraphQLQueriesMode ¶ added in v1.9.0
type GraphQLQueriesMode = server.GraphQLQueriesMode
Re-export enum types and constants from server package for convenience
type Instance ¶
type Instance interface {
Store(ctx context.Context, catalog string, fsys fs.FS) error
Delete(catalog string) error
ContentExists(catalog string) bool
BaseURL(catalog string) string
StorageServerHandler() http.Handler
}
Instance is a storage instance that stores FBC content of catalogs added to a cluster. It can be used to Store or Delete FBC in the host's filesystem. It also a manager runnable object, that starts a server to serve the content stored.
type LocalDirV1 ¶
type LocalDirV1 struct {
RootDir string
RootURL *url.URL
EnableMetasHandler MetasHandlerMode
EnableGraphQLQueries GraphQLQueriesMode
// contains filtered or unexported fields
}
LocalDirV1 is a storage Instance. When Storing a new FBC contained in fs.FS, the content is first written to a temporary file, after which it is copied to its final destination in RootDir/<catalogName>.jsonl. This is done so that clients accessing the content stored in RootDir/<catalogName>.json1 have an atomic view of the content for a catalog.
func NewLocalDirV1 ¶ added in v1.9.0
func NewLocalDirV1(rootDir string, rootURL *url.URL, enableMetasHandler MetasHandlerMode, enableGraphQLQueries GraphQLQueriesMode) *LocalDirV1
NewLocalDirV1 creates a new LocalDirV1 storage instance
func (*LocalDirV1) BaseURL ¶
func (s *LocalDirV1) BaseURL(catalog string) string
func (*LocalDirV1) ContentExists ¶
func (s *LocalDirV1) ContentExists(catalog string) bool
func (*LocalDirV1) Delete ¶
func (s *LocalDirV1) Delete(catalog string) error
func (*LocalDirV1) GetCatalogData ¶ added in v1.9.0
GetCatalogData returns the catalog file and its metadata Implements server.CatalogStore interface
func (*LocalDirV1) GetCatalogFS ¶ added in v1.9.0
func (s *LocalDirV1) GetCatalogFS(catalog string) (fs.FS, error)
GetCatalogFS returns a filesystem interface for the catalog Implements server.CatalogStore interface
func (*LocalDirV1) GetIndex ¶ added in v1.9.0
func (s *LocalDirV1) GetIndex(catalog string) (server.Index, error)
GetIndex returns the index for a catalog Implements server.CatalogStore interface
func (*LocalDirV1) StorageServerHandler ¶
func (s *LocalDirV1) StorageServerHandler() http.Handler
StorageServerHandler returns an HTTP handler for serving catalog content This implements the Instance interface for backward compatibility
type MetasHandlerMode ¶ added in v1.9.0
type MetasHandlerMode = server.MetasHandlerMode
Re-export enum types and constants from server package for convenience