code
stringlengths 12
335k
| docstring
stringlengths 20
20.8k
| func_name
stringlengths 1
105
| language
stringclasses 1
value | repo
stringclasses 498
values | path
stringlengths 5
172
| url
stringlengths 43
235
| license
stringclasses 4
values |
---|---|---|---|---|---|---|---|
func MessageReflect(m Message) protoreflect.Message {
return protoimpl.X.MessageOf(m)
} | MessageReflect returns a reflective view for a message.
It returns nil if m is nil. | MessageReflect | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/proto.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/proto.go | Apache-2.0 |
func Clone(src Message) Message {
return MessageV1(protoV2.Clone(MessageV2(src)))
} | Clone returns a deep copy of src. | Clone | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/proto.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/proto.go | Apache-2.0 |
func Merge(dst, src Message) {
protoV2.Merge(MessageV2(dst), MessageV2(src))
} | Merge merges src into dst, which must be messages of the same type.
Populated scalar fields in src are copied to dst, while populated
singular messages in src are merged into dst by recursively calling Merge.
The elements of every list field in src is appended to the corresponded
list fields in dst. The entries of every map field in src is copied into
the corresponding map field in dst, possibly replacing existing entries.
The unknown fields of src are appended to the unknown fields of dst. | Merge | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/proto.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/proto.go | Apache-2.0 |
func Equal(x, y Message) bool {
return protoV2.Equal(MessageV2(x), MessageV2(y))
} | Equal reports whether two messages are equal.
If two messages marshal to the same bytes under deterministic serialization,
then Equal is guaranteed to report true.
Two messages are equal if they are the same protobuf message type,
have the same set of populated known and extension field values,
and the same set of unknown fields values.
Scalar values are compared with the equivalent of the == operator in Go,
except bytes values which are compared using bytes.Equal and
floating point values which specially treat NaNs as equal.
Message values are compared by recursively calling Equal.
Lists are equal if each element value is also equal.
Maps are equal if they have the same set of keys, where the pair of values
for each key is also equal. | Equal | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/proto.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/proto.go | Apache-2.0 |
func (tm *TextMarshaler) Marshal(w io.Writer, m Message) error {
b, err := tm.marshal(m)
if len(b) > 0 {
if _, err := w.Write(b); err != nil {
return err
}
}
return err
} | Marshal writes the proto text format of m to w. | Marshal | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/text_encode.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/text_encode.go | Apache-2.0 |
func (tm *TextMarshaler) Text(m Message) string {
b, _ := tm.marshal(m)
return string(b)
} | Text returns a proto text formatted string of m. | Text | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/text_encode.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/text_encode.go | Apache-2.0 |
func MarshalText(w io.Writer, m Message) error { return defaultTextMarshaler.Marshal(w, m) } | MarshalText writes the proto text format of m to w. | MarshalText | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/text_encode.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/text_encode.go | Apache-2.0 |
func MarshalTextString(m Message) string { return defaultTextMarshaler.Text(m) } | MarshalTextString returns a proto text formatted string of m. | MarshalTextString | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/text_encode.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/text_encode.go | Apache-2.0 |
func CompactText(w io.Writer, m Message) error { return compactTextMarshaler.Marshal(w, m) } | CompactText writes the compact proto text format of m to w. | CompactText | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/text_encode.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/text_encode.go | Apache-2.0 |
func CompactTextString(m Message) string { return compactTextMarshaler.Text(m) } | CompactTextString returns a compact proto text formatted string of m. | CompactTextString | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/text_encode.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/text_encode.go | Apache-2.0 |
func (w *textWriter) writeProto3Any(m protoreflect.Message) (bool, error) {
md := m.Descriptor()
fdURL := md.Fields().ByName("type_url")
fdVal := md.Fields().ByName("value")
url := m.Get(fdURL).String()
mt, err := protoregistry.GlobalTypes.FindMessageByURL(url)
if err != nil {
return false, nil
}
b := m.Get(fdVal).Bytes()
m2 := mt.New()
if err := proto.Unmarshal(b, m2.Interface()); err != nil {
return false, nil
}
w.Write([]byte("["))
if requiresQuotes(url) {
w.writeQuotedString(url)
} else {
w.Write([]byte(url))
}
if w.compact {
w.Write([]byte("]:<"))
} else {
w.Write([]byte("]: <\n"))
w.indent++
}
if err := w.writeMessage(m2); err != nil {
return true, err
}
if w.compact {
w.Write([]byte("> "))
} else {
w.indent--
w.Write([]byte(">\n"))
}
return true, nil
} | writeProto3Any writes an expanded google.protobuf.Any message.
It returns (false, nil) if sv value can't be unmarshaled (e.g. because
required messages are not linked in).
It returns (true, error) when sv was written in expanded format or an error
was encountered. | writeProto3Any | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/text_encode.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/text_encode.go | Apache-2.0 |
func (w *textWriter) writeQuotedString(s string) {
w.WriteByte('"')
for i := 0; i < len(s); i++ {
switch c := s[i]; c {
case '\n':
w.buf = append(w.buf, `\n`...)
case '\r':
w.buf = append(w.buf, `\r`...)
case '\t':
w.buf = append(w.buf, `\t`...)
case '"':
w.buf = append(w.buf, `\"`...)
case '\\':
w.buf = append(w.buf, `\\`...)
default:
if isPrint := c >= 0x20 && c < 0x7f; isPrint {
w.buf = append(w.buf, c)
} else {
w.buf = append(w.buf, fmt.Sprintf(`\%03o`, c)...)
}
}
}
w.WriteByte('"')
} | writeQuotedString writes a quoted string in the protocol buffer text format. | writeQuotedString | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/text_encode.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/text_encode.go | Apache-2.0 |
func (w *textWriter) writeExtensions(m protoreflect.Message) error {
md := m.Descriptor()
if md.ExtensionRanges().Len() == 0 {
return nil
}
type ext struct {
desc protoreflect.FieldDescriptor
val protoreflect.Value
}
var exts []ext
m.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool {
if fd.IsExtension() {
exts = append(exts, ext{fd, v})
}
return true
})
sort.Slice(exts, func(i, j int) bool {
return exts[i].desc.Number() < exts[j].desc.Number()
})
for _, ext := range exts {
// For message set, use the name of the message as the extension name.
name := string(ext.desc.FullName())
if isMessageSet(ext.desc.ContainingMessage()) {
name = strings.TrimSuffix(name, ".message_set_extension")
}
if !ext.desc.IsList() {
if err := w.writeSingularExtension(name, ext.val, ext.desc); err != nil {
return err
}
} else {
lv := ext.val.List()
for i := 0; i < lv.Len(); i++ {
if err := w.writeSingularExtension(name, lv.Get(i), ext.desc); err != nil {
return err
}
}
}
}
return nil
} | writeExtensions writes all the extensions in m. | writeExtensions | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/text_encode.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/text_encode.go | Apache-2.0 |
func GetStats() Stats { return Stats{} } | Deprecated: Do not use. | GetStats | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/deprecated.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/deprecated.go | Apache-2.0 |
func MarshalMessageSet(interface{}) ([]byte, error) {
return nil, errors.New("proto: not implemented")
} | Deprecated: Do not use. | MarshalMessageSet | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/deprecated.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/deprecated.go | Apache-2.0 |
func UnmarshalMessageSet([]byte, interface{}) error {
return errors.New("proto: not implemented")
} | Deprecated: Do not use. | UnmarshalMessageSet | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/deprecated.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/deprecated.go | Apache-2.0 |
func MarshalMessageSetJSON(interface{}) ([]byte, error) {
return nil, errors.New("proto: not implemented")
} | Deprecated: Do not use. | MarshalMessageSetJSON | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/deprecated.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/deprecated.go | Apache-2.0 |
func UnmarshalMessageSetJSON([]byte, interface{}) error {
return errors.New("proto: not implemented")
} | Deprecated: Do not use. | UnmarshalMessageSetJSON | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/deprecated.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/deprecated.go | Apache-2.0 |
func RegisterMessageSetType(Message, int32, string) {} | Deprecated: Do not use. | RegisterMessageSetType | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/deprecated.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/deprecated.go | Apache-2.0 |
func EnumName(m map[int32]string, v int32) string {
s, ok := m[v]
if ok {
return s
}
return strconv.Itoa(int(v))
} | Deprecated: Do not use. | EnumName | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/deprecated.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/deprecated.go | Apache-2.0 |
func UnmarshalJSONEnum(m map[string]int32, data []byte, enumName string) (int32, error) {
if data[0] == '"' {
// New style: enums are strings.
var repr string
if err := json.Unmarshal(data, &repr); err != nil {
return -1, err
}
val, ok := m[repr]
if !ok {
return 0, fmt.Errorf("unrecognized enum %s value %q", enumName, repr)
}
return val, nil
}
// Old style: enums are ints.
var val int32
if err := json.Unmarshal(data, &val); err != nil {
return 0, fmt.Errorf("cannot unmarshal %#q into enum %s", data, enumName)
}
return val, nil
} | Deprecated: Do not use. | UnmarshalJSONEnum | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/deprecated.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/deprecated.go | Apache-2.0 |
func (*InternalMessageInfo) DiscardUnknown(m Message) {
DiscardUnknown(m)
} | Deprecated: Do not use; this method existed for intenal-use only. | DiscardUnknown | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/deprecated.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/deprecated.go | Apache-2.0 |
func (*InternalMessageInfo) Marshal(b []byte, m Message, deterministic bool) ([]byte, error) {
return protoV2.MarshalOptions{Deterministic: deterministic}.MarshalAppend(b, MessageV2(m))
} | Deprecated: Do not use; this method existed for intenal-use only. | Marshal | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/deprecated.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/deprecated.go | Apache-2.0 |
func (*InternalMessageInfo) Merge(dst, src Message) {
protoV2.Merge(MessageV2(dst), MessageV2(src))
} | Deprecated: Do not use; this method existed for intenal-use only. | Merge | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/deprecated.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/deprecated.go | Apache-2.0 |
func (*InternalMessageInfo) Size(m Message) int {
return protoV2.Size(MessageV2(m))
} | Deprecated: Do not use; this method existed for intenal-use only. | Size | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/deprecated.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/deprecated.go | Apache-2.0 |
func (*InternalMessageInfo) Unmarshal(m Message, b []byte) error {
return protoV2.UnmarshalOptions{Merge: true}.Unmarshal(b, MessageV2(m))
} | Deprecated: Do not use; this method existed for intenal-use only. | Unmarshal | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/deprecated.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/deprecated.go | Apache-2.0 |
func RegisterFile(s filePath, d fileDescGZIP) {
// Decompress the descriptor.
zr, err := gzip.NewReader(bytes.NewReader(d))
if err != nil {
panic(fmt.Sprintf("proto: invalid compressed file descriptor: %v", err))
}
b, err := ioutil.ReadAll(zr)
if err != nil {
panic(fmt.Sprintf("proto: invalid compressed file descriptor: %v", err))
}
// Construct a protoreflect.FileDescriptor from the raw descriptor.
// Note that DescBuilder.Build automatically registers the constructed
// file descriptor with the v2 registry.
protoimpl.DescBuilder{RawDescriptor: b}.Build()
// Locally cache the raw descriptor form for the file.
fileCache.Store(s, d)
} | RegisterFile is called from generated code to register the compressed
FileDescriptorProto with the file path for a proto source file.
Deprecated: Use protoregistry.GlobalFiles.RegisterFile instead. | RegisterFile | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/registry.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/registry.go | Apache-2.0 |
func FileDescriptor(s filePath) fileDescGZIP {
if v, ok := fileCache.Load(s); ok {
return v.(fileDescGZIP)
}
// Find the descriptor in the v2 registry.
var b []byte
if fd, _ := protoregistry.GlobalFiles.FindFileByPath(s); fd != nil {
b, _ = Marshal(protodesc.ToFileDescriptorProto(fd))
}
// Locally cache the raw descriptor form for the file.
if len(b) > 0 {
v, _ := fileCache.LoadOrStore(s, protoimpl.X.CompressGZIP(b))
return v.(fileDescGZIP)
}
return nil
} | FileDescriptor returns the compressed FileDescriptorProto given the file path
for a proto source file. It returns nil if not found.
Deprecated: Use protoregistry.GlobalFiles.FindFileByPath instead. | FileDescriptor | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/registry.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/registry.go | Apache-2.0 |
func RegisterEnum(s enumName, _ enumsByNumber, m enumsByName) {
if _, ok := enumCache.Load(s); ok {
panic("proto: duplicate enum registered: " + s)
}
enumCache.Store(s, m)
// This does not forward registration to the v2 registry since this API
// lacks sufficient information to construct a complete v2 enum descriptor.
} | RegisterEnum is called from the generated code to register the mapping of
enum value names to enum numbers for the enum identified by s.
Deprecated: Use protoregistry.GlobalTypes.RegisterEnum instead. | RegisterEnum | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/registry.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/registry.go | Apache-2.0 |
func EnumValueMap(s enumName) enumsByName {
if v, ok := enumCache.Load(s); ok {
return v.(enumsByName)
}
// Check whether the cache is stale. If the number of files in the current
// package differs, then it means that some enums may have been recently
// registered upstream that we do not know about.
var protoPkg protoreflect.FullName
if i := strings.LastIndexByte(s, '.'); i >= 0 {
protoPkg = protoreflect.FullName(s[:i])
}
v, _ := numFilesCache.Load(protoPkg)
numFiles, _ := v.(int)
if protoregistry.GlobalFiles.NumFilesByPackage(protoPkg) == numFiles {
return nil // cache is up-to-date; was not found earlier
}
// Update the enum cache for all enums declared in the given proto package.
numFiles = 0
protoregistry.GlobalFiles.RangeFilesByPackage(protoPkg, func(fd protoreflect.FileDescriptor) bool {
walkEnums(fd, func(ed protoreflect.EnumDescriptor) {
name := protoimpl.X.LegacyEnumName(ed)
if _, ok := enumCache.Load(name); !ok {
m := make(enumsByName)
evs := ed.Values()
for i := evs.Len() - 1; i >= 0; i-- {
ev := evs.Get(i)
m[string(ev.Name())] = int32(ev.Number())
}
enumCache.LoadOrStore(name, m)
}
})
numFiles++
return true
})
numFilesCache.Store(protoPkg, numFiles)
// Check cache again for enum map.
if v, ok := enumCache.Load(s); ok {
return v.(enumsByName)
}
return nil
} | EnumValueMap returns the mapping from enum value names to enum numbers for
the enum of the given name. It returns nil if not found.
Deprecated: Use protoregistry.GlobalTypes.FindEnumByName instead. | EnumValueMap | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/registry.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/registry.go | Apache-2.0 |
func walkEnums(d interface {
Enums() protoreflect.EnumDescriptors
Messages() protoreflect.MessageDescriptors
}, f func(protoreflect.EnumDescriptor)) {
eds := d.Enums()
for i := eds.Len() - 1; i >= 0; i-- {
f(eds.Get(i))
}
mds := d.Messages()
for i := mds.Len() - 1; i >= 0; i-- {
walkEnums(mds.Get(i), f)
}
} | walkEnums recursively walks all enums declared in d. | walkEnums | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/registry.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/registry.go | Apache-2.0 |
func RegisterType(m Message, s messageName) {
mt := protoimpl.X.LegacyMessageTypeOf(m, protoreflect.FullName(s))
if err := protoregistry.GlobalTypes.RegisterMessage(mt); err != nil {
panic(err)
}
messageTypeCache.Store(s, reflect.TypeOf(m))
} | RegisterType is called from generated code to register the message Go type
for a message of the given name.
Deprecated: Use protoregistry.GlobalTypes.RegisterMessage instead. | RegisterType | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/registry.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/registry.go | Apache-2.0 |
func RegisterMapType(m interface{}, s messageName) {
t := reflect.TypeOf(m)
if t.Kind() != reflect.Map {
panic(fmt.Sprintf("invalid map kind: %v", t))
}
if _, ok := messageTypeCache.Load(s); ok {
panic(fmt.Errorf("proto: duplicate proto message registered: %s", s))
}
messageTypeCache.Store(s, t)
} | RegisterMapType is called from generated code to register the Go map type
for a protobuf message representing a map entry.
Deprecated: Do not use. | RegisterMapType | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/registry.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/registry.go | Apache-2.0 |
func MessageType(s messageName) reflect.Type {
if v, ok := messageTypeCache.Load(s); ok {
return v.(reflect.Type)
}
// Derive the message type from the v2 registry.
var t reflect.Type
if mt, _ := protoregistry.GlobalTypes.FindMessageByName(protoreflect.FullName(s)); mt != nil {
t = messageGoType(mt)
}
// If we could not get a concrete type, it is possible that it is a
// pseudo-message for a map entry.
if t == nil {
d, _ := protoregistry.GlobalFiles.FindDescriptorByName(protoreflect.FullName(s))
if md, _ := d.(protoreflect.MessageDescriptor); md != nil && md.IsMapEntry() {
kt := goTypeForField(md.Fields().ByNumber(1))
vt := goTypeForField(md.Fields().ByNumber(2))
t = reflect.MapOf(kt, vt)
}
}
// Locally cache the message type for the given name.
if t != nil {
v, _ := messageTypeCache.LoadOrStore(s, t)
return v.(reflect.Type)
}
return nil
} | MessageType returns the message type for a named message.
It returns nil if not found.
Deprecated: Use protoregistry.GlobalTypes.FindMessageByName instead. | MessageType | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/registry.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/registry.go | Apache-2.0 |
func MessageName(m Message) messageName {
if m == nil {
return ""
}
if m, ok := m.(interface{ XXX_MessageName() messageName }); ok {
return m.XXX_MessageName()
}
return messageName(protoimpl.X.MessageDescriptorOf(m).FullName())
} | MessageName returns the full protobuf name for the given message type.
Deprecated: Use protoreflect.MessageDescriptor.FullName instead. | MessageName | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/registry.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/registry.go | Apache-2.0 |
func RegisterExtension(d *ExtensionDesc) {
if err := protoregistry.GlobalTypes.RegisterExtension(d); err != nil {
panic(err)
}
} | RegisterExtension is called from the generated code to register
the extension descriptor.
Deprecated: Use protoregistry.GlobalTypes.RegisterExtension instead. | RegisterExtension | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/registry.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/registry.go | Apache-2.0 |
func RegisteredExtensions(m Message) extensionsByNumber {
// Check whether the cache is stale. If the number of extensions for
// the given message differs, then it means that some extensions were
// recently registered upstream that we do not know about.
s := MessageName(m)
v, _ := extensionCache.Load(s)
xs, _ := v.(extensionsByNumber)
if protoregistry.GlobalTypes.NumExtensionsByMessage(protoreflect.FullName(s)) == len(xs) {
return xs // cache is up-to-date
}
// Cache is stale, re-compute the extensions map.
xs = make(extensionsByNumber)
protoregistry.GlobalTypes.RangeExtensionsByMessage(protoreflect.FullName(s), func(xt protoreflect.ExtensionType) bool {
if xd, ok := xt.(*ExtensionDesc); ok {
xs[int32(xt.TypeDescriptor().Number())] = xd
} else {
// TODO: This implies that the protoreflect.ExtensionType is a
// custom type not generated by protoc-gen-go. We could try and
// convert the type to an ExtensionDesc.
}
return true
})
extensionCache.Store(s, xs)
return xs
} | RegisteredExtensions returns a map of the registered extensions for the
provided protobuf message, indexed by the extension field number.
Deprecated: Use protoregistry.GlobalTypes.RangeExtensionsByMessage instead. | RegisteredExtensions | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/registry.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/registry.go | Apache-2.0 |
func DiscardUnknown(m Message) {
if m != nil {
discardUnknown(MessageReflect(m))
}
} | DiscardUnknown recursively discards all unknown fields from this message
and all embedded messages.
When unmarshaling a message with unrecognized fields, the tags and values
of such fields are preserved in the Message. This allows a later call to
marshal to be able to produce a message that continues to have those
unrecognized fields. To avoid this, DiscardUnknown is used to
explicitly clear the unknown fields after unmarshaling. | DiscardUnknown | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/protobuf/proto/discard.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/protobuf/proto/discard.go | Apache-2.0 |
func New(maxEntries int) *Cache {
return &Cache{
MaxEntries: maxEntries,
ll: list.New(),
cache: make(map[interface{}]*list.Element),
}
} | New creates a new Cache.
If maxEntries is zero, the cache has no limit and it's assumed
that eviction is done by the caller. | New | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/groupcache/lru/lru.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/groupcache/lru/lru.go | Apache-2.0 |
func (c *Cache) Add(key Key, value interface{}) {
if c.cache == nil {
c.cache = make(map[interface{}]*list.Element)
c.ll = list.New()
}
if ee, ok := c.cache[key]; ok {
c.ll.MoveToFront(ee)
ee.Value.(*entry).value = value
return
}
ele := c.ll.PushFront(&entry{key, value})
c.cache[key] = ele
if c.MaxEntries != 0 && c.ll.Len() > c.MaxEntries {
c.RemoveOldest()
}
} | Add adds a value to the cache. | Add | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/groupcache/lru/lru.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/groupcache/lru/lru.go | Apache-2.0 |
func (c *Cache) Get(key Key) (value interface{}, ok bool) {
if c.cache == nil {
return
}
if ele, hit := c.cache[key]; hit {
c.ll.MoveToFront(ele)
return ele.Value.(*entry).value, true
}
return
} | Get looks up a key's value from the cache. | Get | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/groupcache/lru/lru.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/groupcache/lru/lru.go | Apache-2.0 |
func (c *Cache) Remove(key Key) {
if c.cache == nil {
return
}
if ele, hit := c.cache[key]; hit {
c.removeElement(ele)
}
} | Remove removes the provided key from the cache. | Remove | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/groupcache/lru/lru.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/groupcache/lru/lru.go | Apache-2.0 |
func (c *Cache) RemoveOldest() {
if c.cache == nil {
return
}
ele := c.ll.Back()
if ele != nil {
c.removeElement(ele)
}
} | RemoveOldest removes the oldest item from the cache. | RemoveOldest | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/groupcache/lru/lru.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/groupcache/lru/lru.go | Apache-2.0 |
func (c *Cache) Len() int {
if c.cache == nil {
return 0
}
return c.ll.Len()
} | Len returns the number of items in the cache. | Len | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/groupcache/lru/lru.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/groupcache/lru/lru.go | Apache-2.0 |
func (c *Cache) Clear() {
if c.OnEvicted != nil {
for _, e := range c.cache {
kv := e.Value.(*entry)
c.OnEvicted(kv.key, kv.value)
}
}
c.ll = nil
c.cache = nil
} | Clear purges all stored items from the cache. | Clear | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/golang/groupcache/lru/lru.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/golang/groupcache/lru/lru.go | Apache-2.0 |
func New(message string) error {
return &fundamental{
msg: message,
stack: callers(),
}
} | New returns an error with the supplied message.
New also records the stack trace at the point it was called. | New | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/pkg/errors/errors.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/pkg/errors/errors.go | Apache-2.0 |
func Errorf(format string, args ...interface{}) error {
return &fundamental{
msg: fmt.Sprintf(format, args...),
stack: callers(),
}
} | Errorf formats according to a format specifier and returns the string
as a value that satisfies error.
Errorf also records the stack trace at the point it was called. | Errorf | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/pkg/errors/errors.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/pkg/errors/errors.go | Apache-2.0 |
func WithStack(err error) error {
if err == nil {
return nil
}
return &withStack{
err,
callers(),
}
} | WithStack annotates err with a stack trace at the point WithStack was called.
If err is nil, WithStack returns nil. | WithStack | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/pkg/errors/errors.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/pkg/errors/errors.go | Apache-2.0 |
func (w *withStack) Unwrap() error { return w.error } | Unwrap provides compatibility for Go 1.13 error chains. | Unwrap | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/pkg/errors/errors.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/pkg/errors/errors.go | Apache-2.0 |
func Wrap(err error, message string) error {
if err == nil {
return nil
}
err = &withMessage{
cause: err,
msg: message,
}
return &withStack{
err,
callers(),
}
} | Wrap returns an error annotating err with a stack trace
at the point Wrap is called, and the supplied message.
If err is nil, Wrap returns nil. | Wrap | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/pkg/errors/errors.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/pkg/errors/errors.go | Apache-2.0 |
func Wrapf(err error, format string, args ...interface{}) error {
if err == nil {
return nil
}
err = &withMessage{
cause: err,
msg: fmt.Sprintf(format, args...),
}
return &withStack{
err,
callers(),
}
} | Wrapf returns an error annotating err with a stack trace
at the point Wrapf is called, and the format specifier.
If err is nil, Wrapf returns nil. | Wrapf | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/pkg/errors/errors.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/pkg/errors/errors.go | Apache-2.0 |
func WithMessage(err error, message string) error {
if err == nil {
return nil
}
return &withMessage{
cause: err,
msg: message,
}
} | WithMessage annotates err with a new message.
If err is nil, WithMessage returns nil. | WithMessage | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/pkg/errors/errors.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/pkg/errors/errors.go | Apache-2.0 |
func WithMessagef(err error, format string, args ...interface{}) error {
if err == nil {
return nil
}
return &withMessage{
cause: err,
msg: fmt.Sprintf(format, args...),
}
} | WithMessagef annotates err with the format specifier.
If err is nil, WithMessagef returns nil. | WithMessagef | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/pkg/errors/errors.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/pkg/errors/errors.go | Apache-2.0 |
func (w *withMessage) Unwrap() error { return w.cause } | Unwrap provides compatibility for Go 1.13 error chains. | Unwrap | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/pkg/errors/errors.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/pkg/errors/errors.go | Apache-2.0 |
func Cause(err error) error {
type causer interface {
Cause() error
}
for err != nil {
cause, ok := err.(causer)
if !ok {
break
}
err = cause.Cause()
}
return err
} | Cause returns the underlying cause of the error, if possible.
An error value has a cause if it implements the following
interface:
type causer interface {
Cause() error
}
If the error does not implement Cause, the original error will
be returned. If the error is nil, nil will be returned without further
investigation. | Cause | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/pkg/errors/errors.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/pkg/errors/errors.go | Apache-2.0 |
func (f Frame) pc() uintptr { return uintptr(f) - 1 } | pc returns the program counter for this frame;
multiple frames may have the same PC value. | pc | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/pkg/errors/stack.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/pkg/errors/stack.go | Apache-2.0 |
func (f Frame) file() string {
fn := runtime.FuncForPC(f.pc())
if fn == nil {
return "unknown"
}
file, _ := fn.FileLine(f.pc())
return file
} | file returns the full path to the file that contains the
function for this Frame's pc. | file | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/pkg/errors/stack.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/pkg/errors/stack.go | Apache-2.0 |
func (f Frame) line() int {
fn := runtime.FuncForPC(f.pc())
if fn == nil {
return 0
}
_, line := fn.FileLine(f.pc())
return line
} | line returns the line number of source code of the
function for this Frame's pc. | line | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/pkg/errors/stack.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/pkg/errors/stack.go | Apache-2.0 |
func (f Frame) name() string {
fn := runtime.FuncForPC(f.pc())
if fn == nil {
return "unknown"
}
return fn.Name()
} | name returns the name of this function, if known. | name | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/pkg/errors/stack.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/pkg/errors/stack.go | Apache-2.0 |
func (f Frame) Format(s fmt.State, verb rune) {
switch verb {
case 's':
switch {
case s.Flag('+'):
io.WriteString(s, f.name())
io.WriteString(s, "\n\t")
io.WriteString(s, f.file())
default:
io.WriteString(s, path.Base(f.file()))
}
case 'd':
io.WriteString(s, strconv.Itoa(f.line()))
case 'n':
io.WriteString(s, funcname(f.name()))
case 'v':
f.Format(s, 's')
io.WriteString(s, ":")
f.Format(s, 'd')
}
} | Format formats the frame according to the fmt.Formatter interface.
%s source file
%d source line
%n function name
%v equivalent to %s:%d
Format accepts flags that alter the printing of some verbs, as follows:
%+s function name and path of source file relative to the compile time
GOPATH separated by \n\t (<funcname>\n\t<path>)
%+v equivalent to %+s:%d | Format | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/pkg/errors/stack.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/pkg/errors/stack.go | Apache-2.0 |
func (f Frame) MarshalText() ([]byte, error) {
name := f.name()
if name == "unknown" {
return []byte(name), nil
}
return []byte(fmt.Sprintf("%s %s:%d", name, f.file(), f.line())), nil
} | MarshalText formats a stacktrace Frame as a text string. The output is the
same as that of fmt.Sprintf("%+v", f), but without newlines or tabs. | MarshalText | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/pkg/errors/stack.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/pkg/errors/stack.go | Apache-2.0 |
func (st StackTrace) Format(s fmt.State, verb rune) {
switch verb {
case 'v':
switch {
case s.Flag('+'):
for _, f := range st {
io.WriteString(s, "\n")
f.Format(s, verb)
}
case s.Flag('#'):
fmt.Fprintf(s, "%#v", []Frame(st))
default:
st.formatSlice(s, verb)
}
case 's':
st.formatSlice(s, verb)
}
} | Format formats the stack of Frames according to the fmt.Formatter interface.
%s lists source files for each Frame in the stack
%v lists the source file and line number for each Frame in the stack
Format accepts flags that alter the printing of some verbs, as follows:
%+v Prints filename, function, and line number for each Frame in the stack. | Format | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/pkg/errors/stack.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/pkg/errors/stack.go | Apache-2.0 |
func (st StackTrace) formatSlice(s fmt.State, verb rune) {
io.WriteString(s, "[")
for i, f := range st {
if i > 0 {
io.WriteString(s, " ")
}
f.Format(s, verb)
}
io.WriteString(s, "]")
} | formatSlice will format this StackTrace into the given buffer as a slice of
Frame, only valid when called with '%s' or '%v'. | formatSlice | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/pkg/errors/stack.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/pkg/errors/stack.go | Apache-2.0 |
func funcname(name string) string {
i := strings.LastIndex(name, "/")
name = name[i+1:]
i = strings.Index(name, ".")
return name[i+1:]
} | funcname removes the path prefix component of a function's name reported by func.Name(). | funcname | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/pkg/errors/stack.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/pkg/errors/stack.go | Apache-2.0 |
func Is(err, target error) bool { return stderrors.Is(err, target) } | Is reports whether any error in err's chain matches target.
The chain consists of err itself followed by the sequence of errors obtained by
repeatedly calling Unwrap.
An error is considered to match a target if it is equal to that target or if
it implements a method Is(error) bool such that Is(target) returns true. | Is | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/pkg/errors/go113.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/pkg/errors/go113.go | Apache-2.0 |
func As(err error, target interface{}) bool { return stderrors.As(err, target) } | As finds the first error in err's chain that matches target, and if so, sets
target to that error value and returns true.
The chain consists of err itself followed by the sequence of errors obtained by
repeatedly calling Unwrap.
An error matches target if the error's concrete value is assignable to the value
pointed to by target, or if the error has a method As(interface{}) bool such that
As(target) returns true. In the latter case, the As method is responsible for
setting target.
As will panic if target is not a non-nil pointer to either a type that implements
error, or to any interface type. As returns false if err is nil. | As | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/pkg/errors/go113.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/pkg/errors/go113.go | Apache-2.0 |
func Unwrap(err error) error {
return stderrors.Unwrap(err)
} | Unwrap returns the result of calling the Unwrap method on err, if err's
type contains an Unwrap method returning error.
Otherwise, Unwrap returns nil. | Unwrap | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/pkg/errors/go113.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/pkg/errors/go113.go | Apache-2.0 |
func (f *FlagSet) GetFloat32(name string) (float32, error) {
val, err := f.getFlagType(name, "float32", float32Conv)
if err != nil {
return 0, err
}
return val.(float32), nil
} | GetFloat32 return the float32 value of a flag with the given name | GetFloat32 | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/spf13/pflag/float32.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/float32.go | Apache-2.0 |
func (f *FlagSet) Float32Var(p *float32, name string, value float32, usage string) {
f.VarP(newFloat32Value(value, p), name, "", usage)
} | Float32Var defines a float32 flag with specified name, default value, and usage string.
The argument p points to a float32 variable in which to store the value of the flag. | Float32Var | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/spf13/pflag/float32.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/float32.go | Apache-2.0 |
func (f *FlagSet) Float32VarP(p *float32, name, shorthand string, value float32, usage string) {
f.VarP(newFloat32Value(value, p), name, shorthand, usage)
} | Float32VarP is like Float32Var, but accepts a shorthand letter that can be used after a single dash. | Float32VarP | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/spf13/pflag/float32.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/float32.go | Apache-2.0 |
func Float32Var(p *float32, name string, value float32, usage string) {
CommandLine.VarP(newFloat32Value(value, p), name, "", usage)
} | Float32Var defines a float32 flag with specified name, default value, and usage string.
The argument p points to a float32 variable in which to store the value of the flag. | Float32Var | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/spf13/pflag/float32.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/float32.go | Apache-2.0 |
func Float32VarP(p *float32, name, shorthand string, value float32, usage string) {
CommandLine.VarP(newFloat32Value(value, p), name, shorthand, usage)
} | Float32VarP is like Float32Var, but accepts a shorthand letter that can be used after a single dash. | Float32VarP | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/spf13/pflag/float32.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/float32.go | Apache-2.0 |
func (f *FlagSet) Float32(name string, value float32, usage string) *float32 {
p := new(float32)
f.Float32VarP(p, name, "", value, usage)
return p
} | Float32 defines a float32 flag with specified name, default value, and usage string.
The return value is the address of a float32 variable that stores the value of the flag. | Float32 | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/spf13/pflag/float32.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/float32.go | Apache-2.0 |
func (f *FlagSet) Float32P(name, shorthand string, value float32, usage string) *float32 {
p := new(float32)
f.Float32VarP(p, name, shorthand, value, usage)
return p
} | Float32P is like Float32, but accepts a shorthand letter that can be used after a single dash. | Float32P | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/spf13/pflag/float32.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/float32.go | Apache-2.0 |
func Float32(name string, value float32, usage string) *float32 {
return CommandLine.Float32P(name, "", value, usage)
} | Float32 defines a float32 flag with specified name, default value, and usage string.
The return value is the address of a float32 variable that stores the value of the flag. | Float32 | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/spf13/pflag/float32.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/float32.go | Apache-2.0 |
func Float32P(name, shorthand string, value float32, usage string) *float32 {
return CommandLine.Float32P(name, shorthand, value, usage)
} | Float32P is like Float32, but accepts a shorthand letter that can be used after a single dash. | Float32P | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/spf13/pflag/float32.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/float32.go | Apache-2.0 |
func (f *FlagSet) GetUint(name string) (uint, error) {
val, err := f.getFlagType(name, "uint", uintConv)
if err != nil {
return 0, err
}
return val.(uint), nil
} | GetUint return the uint value of a flag with the given name | GetUint | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/spf13/pflag/uint.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint.go | Apache-2.0 |
func (f *FlagSet) UintVar(p *uint, name string, value uint, usage string) {
f.VarP(newUintValue(value, p), name, "", usage)
} | UintVar defines a uint flag with specified name, default value, and usage string.
The argument p points to a uint variable in which to store the value of the flag. | UintVar | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/spf13/pflag/uint.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint.go | Apache-2.0 |
func (f *FlagSet) UintVarP(p *uint, name, shorthand string, value uint, usage string) {
f.VarP(newUintValue(value, p), name, shorthand, usage)
} | UintVarP is like UintVar, but accepts a shorthand letter that can be used after a single dash. | UintVarP | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/spf13/pflag/uint.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint.go | Apache-2.0 |
func UintVar(p *uint, name string, value uint, usage string) {
CommandLine.VarP(newUintValue(value, p), name, "", usage)
} | UintVar defines a uint flag with specified name, default value, and usage string.
The argument p points to a uint variable in which to store the value of the flag. | UintVar | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/spf13/pflag/uint.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint.go | Apache-2.0 |
func UintVarP(p *uint, name, shorthand string, value uint, usage string) {
CommandLine.VarP(newUintValue(value, p), name, shorthand, usage)
} | UintVarP is like UintVar, but accepts a shorthand letter that can be used after a single dash. | UintVarP | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/spf13/pflag/uint.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint.go | Apache-2.0 |
func (f *FlagSet) Uint(name string, value uint, usage string) *uint {
p := new(uint)
f.UintVarP(p, name, "", value, usage)
return p
} | Uint defines a uint flag with specified name, default value, and usage string.
The return value is the address of a uint variable that stores the value of the flag. | Uint | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/spf13/pflag/uint.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint.go | Apache-2.0 |
func (f *FlagSet) UintP(name, shorthand string, value uint, usage string) *uint {
p := new(uint)
f.UintVarP(p, name, shorthand, value, usage)
return p
} | UintP is like Uint, but accepts a shorthand letter that can be used after a single dash. | UintP | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/spf13/pflag/uint.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint.go | Apache-2.0 |
func Uint(name string, value uint, usage string) *uint {
return CommandLine.UintP(name, "", value, usage)
} | Uint defines a uint flag with specified name, default value, and usage string.
The return value is the address of a uint variable that stores the value of the flag. | Uint | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/spf13/pflag/uint.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint.go | Apache-2.0 |
func UintP(name, shorthand string, value uint, usage string) *uint {
return CommandLine.UintP(name, shorthand, value, usage)
} | UintP is like Uint, but accepts a shorthand letter that can be used after a single dash. | UintP | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/spf13/pflag/uint.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/uint.go | Apache-2.0 |
func (f *FlagSet) GetFloat64Slice(name string) ([]float64, error) {
val, err := f.getFlagType(name, "float64Slice", float64SliceConv)
if err != nil {
return []float64{}, err
}
return val.([]float64), nil
} | GetFloat64Slice return the []float64 value of a flag with the given name | GetFloat64Slice | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/spf13/pflag/float64_slice.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/float64_slice.go | Apache-2.0 |
func (f *FlagSet) Float64SliceVar(p *[]float64, name string, value []float64, usage string) {
f.VarP(newFloat64SliceValue(value, p), name, "", usage)
} | Float64SliceVar defines a float64Slice flag with specified name, default value, and usage string.
The argument p points to a []float64 variable in which to store the value of the flag. | Float64SliceVar | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/spf13/pflag/float64_slice.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/float64_slice.go | Apache-2.0 |
func (f *FlagSet) Float64SliceVarP(p *[]float64, name, shorthand string, value []float64, usage string) {
f.VarP(newFloat64SliceValue(value, p), name, shorthand, usage)
} | Float64SliceVarP is like Float64SliceVar, but accepts a shorthand letter that can be used after a single dash. | Float64SliceVarP | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/spf13/pflag/float64_slice.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/float64_slice.go | Apache-2.0 |
func Float64SliceVar(p *[]float64, name string, value []float64, usage string) {
CommandLine.VarP(newFloat64SliceValue(value, p), name, "", usage)
} | Float64SliceVar defines a float64[] flag with specified name, default value, and usage string.
The argument p points to a float64[] variable in which to store the value of the flag. | Float64SliceVar | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/spf13/pflag/float64_slice.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/float64_slice.go | Apache-2.0 |
func Float64SliceVarP(p *[]float64, name, shorthand string, value []float64, usage string) {
CommandLine.VarP(newFloat64SliceValue(value, p), name, shorthand, usage)
} | Float64SliceVarP is like Float64SliceVar, but accepts a shorthand letter that can be used after a single dash. | Float64SliceVarP | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/spf13/pflag/float64_slice.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/float64_slice.go | Apache-2.0 |
func (f *FlagSet) Float64Slice(name string, value []float64, usage string) *[]float64 {
p := []float64{}
f.Float64SliceVarP(&p, name, "", value, usage)
return &p
} | Float64Slice defines a []float64 flag with specified name, default value, and usage string.
The return value is the address of a []float64 variable that stores the value of the flag. | Float64Slice | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/spf13/pflag/float64_slice.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/float64_slice.go | Apache-2.0 |
func (f *FlagSet) Float64SliceP(name, shorthand string, value []float64, usage string) *[]float64 {
p := []float64{}
f.Float64SliceVarP(&p, name, shorthand, value, usage)
return &p
} | Float64SliceP is like Float64Slice, but accepts a shorthand letter that can be used after a single dash. | Float64SliceP | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/spf13/pflag/float64_slice.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/float64_slice.go | Apache-2.0 |
func Float64Slice(name string, value []float64, usage string) *[]float64 {
return CommandLine.Float64SliceP(name, "", value, usage)
} | Float64Slice defines a []float64 flag with specified name, default value, and usage string.
The return value is the address of a []float64 variable that stores the value of the flag. | Float64Slice | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/spf13/pflag/float64_slice.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/float64_slice.go | Apache-2.0 |
func Float64SliceP(name, shorthand string, value []float64, usage string) *[]float64 {
return CommandLine.Float64SliceP(name, shorthand, value, usage)
} | Float64SliceP is like Float64Slice, but accepts a shorthand letter that can be used after a single dash. | Float64SliceP | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/spf13/pflag/float64_slice.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/float64_slice.go | Apache-2.0 |
func (s *boolSliceValue) Set(val string) error {
// remove all quote characters
rmQuote := strings.NewReplacer(`"`, "", `'`, "", "`", "")
// read flag arguments with CSV parser
boolStrSlice, err := readAsCSV(rmQuote.Replace(val))
if err != nil && err != io.EOF {
return err
}
// parse boolean values into slice
out := make([]bool, 0, len(boolStrSlice))
for _, boolStr := range boolStrSlice {
b, err := strconv.ParseBool(strings.TrimSpace(boolStr))
if err != nil {
return err
}
out = append(out, b)
}
if !s.changed {
*s.value = out
} else {
*s.value = append(*s.value, out...)
}
s.changed = true
return nil
} | Set converts, and assigns, the comma-separated boolean argument string representation as the []bool value of this flag.
If Set is called on a flag that already has a []bool assigned, the newly converted values will be appended. | Set | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/spf13/pflag/bool_slice.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/bool_slice.go | Apache-2.0 |
func (s *boolSliceValue) Type() string {
return "boolSlice"
} | Type returns a string that uniquely represents this flag's type. | Type | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/spf13/pflag/bool_slice.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/bool_slice.go | Apache-2.0 |
func (s *boolSliceValue) String() string {
boolStrSlice := make([]string, len(*s.value))
for i, b := range *s.value {
boolStrSlice[i] = strconv.FormatBool(b)
}
out, _ := writeAsCSV(boolStrSlice)
return "[" + out + "]"
} | String defines a "native" format for this boolean slice flag value. | String | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/spf13/pflag/bool_slice.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/bool_slice.go | Apache-2.0 |
func (f *FlagSet) GetBoolSlice(name string) ([]bool, error) {
val, err := f.getFlagType(name, "boolSlice", boolSliceConv)
if err != nil {
return []bool{}, err
}
return val.([]bool), nil
} | GetBoolSlice returns the []bool value of a flag with the given name. | GetBoolSlice | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/spf13/pflag/bool_slice.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/bool_slice.go | Apache-2.0 |
func (f *FlagSet) BoolSliceVar(p *[]bool, name string, value []bool, usage string) {
f.VarP(newBoolSliceValue(value, p), name, "", usage)
} | BoolSliceVar defines a boolSlice flag with specified name, default value, and usage string.
The argument p points to a []bool variable in which to store the value of the flag. | BoolSliceVar | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/spf13/pflag/bool_slice.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/bool_slice.go | Apache-2.0 |
func (f *FlagSet) BoolSliceVarP(p *[]bool, name, shorthand string, value []bool, usage string) {
f.VarP(newBoolSliceValue(value, p), name, shorthand, usage)
} | BoolSliceVarP is like BoolSliceVar, but accepts a shorthand letter that can be used after a single dash. | BoolSliceVarP | go | k8snetworkplumbingwg/multus-cni | vendor/github.com/spf13/pflag/bool_slice.go | https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/vendor/github.com/spf13/pflag/bool_slice.go | Apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.