Documentation
¶
Overview ¶
Package filepath provides filepath storage related utilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrFileNotExists = fmt.Errorf("file doesn't exist")
ErrFileNotExists means the file doesn't actually exist.
var ErrNamespaceNotExists = errors.New("namespace does not exist")
ErrNamespaceNotExists means the directory for the namespace doesn't actually exist.
Functions ¶
func NewMemoryREST ¶
func NewMemoryREST( groupResource schema.GroupResource, codec runtime.Codec, isNamespaced bool, newFunc func() runtime.Object, newListFunc func() runtime.Object, ) rest.Storage
NewMemoryREST instantiates a new REST storage.
func NewMemoryStorageProvider ¶
func NewMemoryStorageProvider(obj resource.Object) builderrest.ResourceHandlerProvider
NewMemoryStorageProvider use local host path as persistent layer storage:
For namespaced-scoped resources: the resource will be written under the root-path in the following structure:
-- (root-path) --- /namespace1/ --- resource1 | | | --- resource2 | --- /namespace2/ --- resource3
For cluster-scoped resources, there will be no mid-layer folders for namespaces:
-- (root-path) --- resource1 | --- resource2 | --- resource3
An example of storing example resource to local filepath will be:
builder.APIServer. WithResourceAndHandler(&v1alpha1.ExampleResource{}, jsonfile.NewMemoryStorageProvider(&v1alpha1.ExampleResource{})). Build()
Types ¶
This section is empty.