From defd27f75df3a6eef84ac33adf89b1ce255e738c Mon Sep 17 00:00:00 2001 From: "Joe Richey joerichey@google.com" Date: Wed, 31 May 2017 17:54:35 -0700 Subject: actions: Simplify the callback mechanism This commit makes the callbacks for getting keys easier to understand. Functions which need keys now take a KeyFunc callback. This callback contains a ProtectorInfo parameter (basically a read-only version of metadata.ProtectorData) and a boolean which indicates if the call is being retried. The documentation is also updated to say which functions will retry the KeyFunc. For selecting a protector, there is now an OptionFunc callback which takes a slice of ProtectorOptions. A ProtectorOption is a ProtectorInfo along with additional information about a linked filesystem (if applicable). This commit also adds in methods for getting the protector options for a specific filesystem or policy. It also adds a function for getting the policy descriptor for a specific path. Change-Id: I41e0d94ffd44e7166b0c5cf1b5d18437960bdf90 --- actions/context_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actions/context_test.go') diff --git a/actions/context_test.go b/actions/context_test.go index 671b065..74629a3 100644 --- a/actions/context_test.go +++ b/actions/context_test.go @@ -31,7 +31,7 @@ var mountpoint = os.Getenv("TEST_FILESYSTEM_ROOT") // Makes a context using the testing locations for the filesystem and // configuration file. func makeContext() (*Context, error) { - if err := NewConfigFile(testTime, true); err != nil { + if err := CreateConfigFile(testTime, true); err != nil { return nil, err } -- cgit v1.2.3