forked from metal-stack/go-ipam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
storage.go
18 lines (16 loc) · 851 Bytes
/
storage.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package ipam
import "context"
// Storage is a interface to store ipam objects.
type Storage interface {
Name() string
CreatePrefix(ctx context.Context, prefix Prefix, namespace string) (Prefix, error)
ReadPrefix(ctx context.Context, prefix string, namespace string) (Prefix, error)
DeleteAllPrefixes(ctx context.Context, namespace string) error
ReadAllPrefixes(ctx context.Context, namespace string) (Prefixes, error)
ReadAllPrefixCidrs(ctx context.Context, namespace string) ([]string, error)
UpdatePrefix(ctx context.Context, prefix Prefix, namespace string) (Prefix, error)
DeletePrefix(ctx context.Context, prefix Prefix, namespace string) (Prefix, error)
CreateNamespace(ctx context.Context, namespace string) error
ListNamespaces(ctx context.Context) ([]string, error)
DeleteNamespace(ctx context.Context, namespace string) error
}