4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-09-11 18:12:30 +00:00
Files
.github
bridge
contrib
docker
gateway
hook
img
internal
matterclient
matterhook
vendor
github.com
42wim
Baozisoftware
Jeffail
Philipp15b
Rhymen
SevereCloud
blang
d5
davecgh
dgrijalva
disintegration
dyatlov
francoispqt
fsnotify
go-asn1-ber
go-telegram-bot-api
golang
gomarkdown
google
gopackage
gorilla
hashicorp
jpillora
keybase
kyokomi
labstack
lrstanley
magiconair
matrix-org
matterbridge
mattermost
mattn
mgutz
missdeer
mitchellh
monaco-io
mreiferson
mrexodia
nelsonken
paulrosania
pborman
pelletier
philhofer
pkg
pmezard
rickb777
rs
russross
saintfish
shazow
sirupsen
skip2
slack-go
spf13
afero
cast
jwalterweatherman
pflag
.gitignore
.travis.yml
LICENSE
README.md
bool.go
bool_slice.go
bytes.go
count.go
duration.go
duration_slice.go
flag.go
float32.go
float32_slice.go
float64.go
float64_slice.go
go.mod
go.sum
golangflag.go
int.go
int16.go
int32.go
int32_slice.go
int64.go
int64_slice.go
int8.go
int_slice.go
ip.go
ip_slice.go
ipmask.go
ipnet.go
string.go
string_array.go
string_slice.go
string_to_int.go
string_to_int64.go
string_to_string.go
uint.go
uint16.go
uint32.go
uint64.go
uint8.go
uint_slice.go
viper
stretchr
subosito
technoweenie
tinylib
valyala
vincent-petithory
wiggin77
writeas
yaegashi
zfjagann
go.uber.org
golang.org
gomod.garykim.dev
google.golang.org
gopkg.in
layeh.com
modules.txt
.dockerignore
.fixmie.yml
.gitignore
.golangci.yaml
.goreleaser.yml
Dockerfile
LICENSE
README.md
changelog.md
go.mod
go.sum
matterbridge.go
matterbridge.toml.sample
matterbridge.toml.simple
tgs.Dockerfile
matterbridge/vendor/github.com/spf13/pflag/uint64.go
2018-03-04 23:46:13 +01:00

89 lines
3.0 KiB
Go

package pflag
import "strconv"
// -- uint64 Value
type uint64Value uint64
func newUint64Value(val uint64, p *uint64) *uint64Value {
*p = val
return (*uint64Value)(p)
}
func (i *uint64Value) Set(s string) error {
v, err := strconv.ParseUint(s, 0, 64)
*i = uint64Value(v)
return err
}
func (i *uint64Value) Type() string {
return "uint64"
}
func (i *uint64Value) String() string { return strconv.FormatUint(uint64(*i), 10) }
func uint64Conv(sval string) (interface{}, error) {
v, err := strconv.ParseUint(sval, 0, 64)
if err != nil {
return 0, err
}
return uint64(v), nil
}
// GetUint64 return the uint64 value of a flag with the given name
func (f *FlagSet) GetUint64(name string) (uint64, error) {
val, err := f.getFlagType(name, "uint64", uint64Conv)
if err != nil {
return 0, err
}
return val.(uint64), nil
}
// Uint64Var defines a uint64 flag with specified name, default value, and usage string.
// The argument p points to a uint64 variable in which to store the value of the flag.
func (f *FlagSet) Uint64Var(p *uint64, name string, value uint64, usage string) {
f.VarP(newUint64Value(value, p), name, "", usage)
}
// Uint64VarP is like Uint64Var, but accepts a shorthand letter that can be used after a single dash.
func (f *FlagSet) Uint64VarP(p *uint64, name, shorthand string, value uint64, usage string) {
f.VarP(newUint64Value(value, p), name, shorthand, usage)
}
// Uint64Var defines a uint64 flag with specified name, default value, and usage string.
// The argument p points to a uint64 variable in which to store the value of the flag.
func Uint64Var(p *uint64, name string, value uint64, usage string) {
CommandLine.VarP(newUint64Value(value, p), name, "", usage)
}
// Uint64VarP is like Uint64Var, but accepts a shorthand letter that can be used after a single dash.
func Uint64VarP(p *uint64, name, shorthand string, value uint64, usage string) {
CommandLine.VarP(newUint64Value(value, p), name, shorthand, usage)
}
// Uint64 defines a uint64 flag with specified name, default value, and usage string.
// The return value is the address of a uint64 variable that stores the value of the flag.
func (f *FlagSet) Uint64(name string, value uint64, usage string) *uint64 {
p := new(uint64)
f.Uint64VarP(p, name, "", value, usage)
return p
}
// Uint64P is like Uint64, but accepts a shorthand letter that can be used after a single dash.
func (f *FlagSet) Uint64P(name, shorthand string, value uint64, usage string) *uint64 {
p := new(uint64)
f.Uint64VarP(p, name, shorthand, value, usage)
return p
}
// Uint64 defines a uint64 flag with specified name, default value, and usage string.
// The return value is the address of a uint64 variable that stores the value of the flag.
func Uint64(name string, value uint64, usage string) *uint64 {
return CommandLine.Uint64P(name, "", value, usage)
}
// Uint64P is like Uint64, but accepts a shorthand letter that can be used after a single dash.
func Uint64P(name, shorthand string, value uint64, usage string) *uint64 {
return CommandLine.Uint64P(name, shorthand, value, usage)
}