-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is just a simple "go generate" with a few helpers that I added for umoci's use because it turns out that it's quite handy to have those constants and helpers defined. Signed-off-by: Aleksa Sarai <[email protected]>
- Loading branch information
Showing
5 changed files
with
122 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../rootlesscontainers.proto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* rootlesscontainers-proto: persistent rootless filesystem emulation | ||
* Copyright (C) 2018 Rootless Containers Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package rootlesscontainers | ||
|
||
// Generate everything for our protobuf. | ||
//go:generate protoc --go_out=import_path=rootlesscontainers:. rootlesscontainers.proto | ||
|
||
// Keyname is the official xattr key used to store rootlesscontainers.proto | ||
// blobs, and is the only key we will treat in this special way. | ||
const Keyname = "user.rootlesscontainers" | ||
|
||
// NoopID is the uint32 that represents the "noop" id for uid/gid values. It is | ||
// equal to uint32(-1) but since we cannot write that in Go we have to | ||
// explicitly write the wrapped value. | ||
var NoopID uint32 = 0xFFFFFFFF | ||
|
||
// IsDefault returns whether the given Resource is the default. If a Resource | ||
// is equal to the default Resource then it is not necesary to include it on | ||
// the filesystem. | ||
func IsDefault(r Resource) bool { | ||
return r.Uid == NoopID && r.Gid == NoopID | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters