{"modulePath":"github.com/2lambda123/openshift-origin","version":"v4.1.0+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package mcs\n\n## Types\n\n```go\ntype Categories []uint16\n```\n\n```go\nfunc (c Categories) Len() int\n```\n\n```go\nfunc (c Categories) Less(i, j int) bool\n```\n\n```go\nfunc (categories Categories) Offset() uint64\n```\nOffset returns the rank of the provided categories in the co-lex rank operation (k is implicit)\n\n```go\nfunc (c Categories) Swap(i, j int)\n```\n\n```go\ntype Label struct {\n\tPrefix string\n\tCategories\n}\n```\n\n```go\nfunc NewLabel(prefix string, offset uint64, k uint) (*Label, error)\n```\nNewLabel creates a Label object based on the offset given by offset with a number of labels equal to k. Prefix may be any valid SELinux label (user:role:type:level:).\n\n```go\nfunc ParseLabel(in string) (*Label, error)\n```\nParseLabel converts a string value representing an SELinux label into a Label object, extracting and ordering categories.\n\n```go\nfunc (labels *Label) String() string\n```\n\n```go\ntype Range struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewRange(prefix string, n, k uint) (*Range, error)\n```\nNewRange describes an SELinux category range, where prefix may include the user, type, role, and level of the range, and n and k represent the highest category c0 to c(N-1) and k represents the number of labels to use. A range can be used to check whether a given label matches the range.\n\n```go\nfunc ParseRange(in string) (*Range, error)\n```\nParseRange converts a string value representing an SELinux category range into a Range object, extracting the prefix -- which may include the user, type, and role of the range, the number of labels to use, and the maximum category to use.  The input string is expected to be in the format:\n\n\t\u003cprefix\u003e/\u003cnumLabels\u003e[,\u003cmaxCategory\u003e]\n\nIf the maximum category is not specified, it is defaulted to the maximum number of SELinux categories (1024).\n\n```go\nfunc (r *Range) Contains(label *Label) bool\n```\n\n```go\nfunc (r *Range) LabelAt(offset uint64) (*Label, bool)\n```\n\n```go\nfunc (r *Range) Offset(label *Label) (bool, uint64)\n```\n\n```go\nfunc (r *Range) Size() uint64\n```\n\n```go\nfunc (r *Range) String() string\n```\n\n","path":"github.com/2lambda123/openshift-origin/pkg/security/mcs","name":"mcs","synopsis":"","isRedistributable":true}
