Policy is the interface of a set of defined behavior choosing the upstream Fs to operate on
| 16 | // Policy is the interface of a set of defined behavior choosing |
| 17 | // the upstream Fs to operate on |
| 18 | type Policy interface { |
| 19 | // Action category policy, governing the modification of files and directories |
| 20 | Action(ctx context.Context, upstreams []*upstream.Fs, path string) ([]*upstream.Fs, error) |
| 21 | |
| 22 | // Create category policy, governing the creation of files and directories |
| 23 | Create(ctx context.Context, upstreams []*upstream.Fs, path string) ([]*upstream.Fs, error) |
| 24 | |
| 25 | // Search category policy, governing the access to files and directories |
| 26 | Search(ctx context.Context, upstreams []*upstream.Fs, path string) (*upstream.Fs, error) |
| 27 | |
| 28 | // ActionEntries is ACTION category policy but receiving a set of candidate entries |
| 29 | ActionEntries(entries ...upstream.Entry) ([]upstream.Entry, error) |
| 30 | |
| 31 | // CreateEntries is CREATE category policy but receiving a set of candidate entries |
| 32 | CreateEntries(entries ...upstream.Entry) ([]upstream.Entry, error) |
| 33 | |
| 34 | // SearchEntries is SEARCH category policy but receiving a set of candidate entries |
| 35 | SearchEntries(entries ...upstream.Entry) (upstream.Entry, error) |
| 36 | } |
| 37 | |
| 38 | func registerPolicy(name string, p Policy) { |
| 39 | policies[strings.ToLower(name)] = p |
no outgoing calls
no test coverage detected
searching dependent graphs…