Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Replace caps.FileType with caps.BoolFile with required "path" #206
Conversation
zyga
added some commits
Dec 1, 2015
|
CI failed because the corresponding part of #205 is not merged, I'll change that in a sec. |
zyga
added some commits
Dec 2, 2015
mvo5
reviewed
Dec 2, 2015
| + // | ||
| + // This capability type can be used to describe many boolan flags exposed | ||
| + // in sysfs, including certain hardware like exported GPIO pins. | ||
| + BoolFileType = &Type{ |
mvo5
Dec 2, 2015
Collaborator
Maybe this is more a question for Gustavo, not sure. But is there anything that enforces that BoolFile is a bool file (or will there be anything)? Right now it seems like I could also use it for other files in sysfs or dev. Will there be a DecimalFileType for files like /proc/sys/vm/swappiness that accept a numeric range of parameters? Just curious to understand the longer term vision better .)
zyga
added some commits
Dec 2, 2015
|
|
|
This looks good, but pending work on the underlying branch. |
|
One question, how will this look in the future? Will the fact that its a BoolFile with only 0/1 be enforced in some way by snappy? Or is it just a label for the user/developer? |
|
@mvo5 In the future each type will be a standalone entity that is loaded at start-up. Types will be documented (along with the semantics for application developers). Snappy will not enforce what an application does but I hope to have a library for popular languages for working with capabilities with cleaner APIs than the roll-your-own one might look like. |
zyga commentedDec 2, 2015
This branch depends on #205
This patch kills the early development "file" type and replaces it with
the "bool-file" type that can be used to describe simple GPIO pins.