id
int32
0
167k
repo
stringlengths
5
54
path
stringlengths
4
155
func_name
stringlengths
1
118
original_string
stringlengths
52
85.5k
language
stringclasses
1 value
code
stringlengths
52
85.5k
code_tokens
listlengths
21
1.41k
docstring
stringlengths
6
2.61k
docstring_tokens
listlengths
3
215
sha
stringlengths
40
40
url
stringlengths
85
252
145,100
TheThingsNetwork/ttn
core/networkserver/device/store.go
CountForAddress
func (s *RedisDeviceStore) CountForAddress(devAddr types.DevAddr) (int, error) { return s.devAddrIndex.Count(devAddr.String()) }
go
func (s *RedisDeviceStore) CountForAddress(devAddr types.DevAddr) (int, error) { return s.devAddrIndex.Count(devAddr.String()) }
[ "func", "(", "s", "*", "RedisDeviceStore", ")", "CountForAddress", "(", "devAddr", "types", ".", "DevAddr", ")", "(", "int", ",", "error", ")", "{", "return", "s", ".", "devAddrIndex", ".", "Count", "(", "devAddr", ".", "String", "(", ")", ")", "\n", "}" ]
// CountForAddress counts all devices for a specific DevAddr
[ "CountForAddress", "counts", "all", "devices", "for", "a", "specific", "DevAddr" ]
fc5709a55c20e1712047e5cb5a8d571aa62eefbb
https://github.com/TheThingsNetwork/ttn/blob/fc5709a55c20e1712047e5cb5a8d571aa62eefbb/core/networkserver/device/store.go#L96-L98
145,101
TheThingsNetwork/ttn
core/networkserver/device/store.go
ListForAddress
func (s *RedisDeviceStore) ListForAddress(devAddr types.DevAddr) ([]*Device, error) { deviceKeys, err := s.devAddrIndex.Get(devAddr.String()) if errors.GetErrType(err) == errors.NotFound { return nil, nil } if err != nil { return nil, err } devicesI, err := s.store.GetAll(deviceKeys, nil) if err != nil { return nil, err } devices := make([]*Device, len(devicesI)) for i, deviceI := range devicesI { if device, ok := deviceI.(Device); ok { devices[i] = &device } } return devices, nil }
go
func (s *RedisDeviceStore) ListForAddress(devAddr types.DevAddr) ([]*Device, error) { deviceKeys, err := s.devAddrIndex.Get(devAddr.String()) if errors.GetErrType(err) == errors.NotFound { return nil, nil } if err != nil { return nil, err } devicesI, err := s.store.GetAll(deviceKeys, nil) if err != nil { return nil, err } devices := make([]*Device, len(devicesI)) for i, deviceI := range devicesI { if device, ok := deviceI.(Device); ok { devices[i] = &device } } return devices, nil }
[ "func", "(", "s", "*", "RedisDeviceStore", ")", "ListForAddress", "(", "devAddr", "types", ".", "DevAddr", ")", "(", "[", "]", "*", "Device", ",", "error", ")", "{", "deviceKeys", ",", "err", ":=", "s", ".", "devAddrIndex", ".", "Get", "(", "devAddr", ".", "String", "(", ")", ")", "\n", "if", "errors", ".", "GetErrType", "(", "err", ")", "==", "errors", ".", "NotFound", "{", "return", "nil", ",", "nil", "\n", "}", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "devicesI", ",", "err", ":=", "s", ".", "store", ".", "GetAll", "(", "deviceKeys", ",", "nil", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "devices", ":=", "make", "(", "[", "]", "*", "Device", ",", "len", "(", "devicesI", ")", ")", "\n", "for", "i", ",", "deviceI", ":=", "range", "devicesI", "{", "if", "device", ",", "ok", ":=", "deviceI", ".", "(", "Device", ")", ";", "ok", "{", "devices", "[", "i", "]", "=", "&", "device", "\n", "}", "\n", "}", "\n", "return", "devices", ",", "nil", "\n", "}" ]
// ListForAddress lists all devices for a specific DevAddr
[ "ListForAddress", "lists", "all", "devices", "for", "a", "specific", "DevAddr" ]
fc5709a55c20e1712047e5cb5a8d571aa62eefbb
https://github.com/TheThingsNetwork/ttn/blob/fc5709a55c20e1712047e5cb5a8d571aa62eefbb/core/networkserver/device/store.go#L101-L120
145,102
TheThingsNetwork/ttn
core/networkserver/device/store.go
Frames
func (s *RedisDeviceStore) Frames(appEUI types.AppEUI, devEUI types.DevEUI) (FrameHistory, error) { return &RedisFrameHistory{ appEUI: appEUI, devEUI: devEUI, store: s.frameStore, }, nil }
go
func (s *RedisDeviceStore) Frames(appEUI types.AppEUI, devEUI types.DevEUI) (FrameHistory, error) { return &RedisFrameHistory{ appEUI: appEUI, devEUI: devEUI, store: s.frameStore, }, nil }
[ "func", "(", "s", "*", "RedisDeviceStore", ")", "Frames", "(", "appEUI", "types", ".", "AppEUI", ",", "devEUI", "types", ".", "DevEUI", ")", "(", "FrameHistory", ",", "error", ")", "{", "return", "&", "RedisFrameHistory", "{", "appEUI", ":", "appEUI", ",", "devEUI", ":", "devEUI", ",", "store", ":", "s", ".", "frameStore", ",", "}", ",", "nil", "\n", "}" ]
// Frames history for a specific Device
[ "Frames", "history", "for", "a", "specific", "Device" ]
fc5709a55c20e1712047e5cb5a8d571aa62eefbb
https://github.com/TheThingsNetwork/ttn/blob/fc5709a55c20e1712047e5cb5a8d571aa62eefbb/core/networkserver/device/store.go#L192-L198
145,103
TheThingsNetwork/ttn
ttnctl/util/mqtt.go
GetMQTT
func GetMQTT(ctx ttnlog.Interface, accessKey string) mqtt.Client { username, password, err := getMQTTCredentials(ctx, accessKey) if err != nil { ctx.WithError(err).Fatal("Failed to get MQTT credentials") } mqttProto := "tcp" if strings.HasSuffix(viper.GetString("mqtt-address"), ":8883") { mqttProto = "ssl" ctx.Fatal("TLS connections are not yet supported by ttnctl") } broker := fmt.Sprintf("%s://%s", mqttProto, viper.GetString("mqtt-address")) client := mqtt.NewClient(ctx, "ttnctl", username, password, broker) ctx.WithFields(ttnlog.Fields{ "MQTT Broker": broker, "Username": username, }).Info("Connecting to MQTT...") if err := client.Connect(); err != nil { ctx.WithError(err).Fatal("Could not connect") } return client }
go
func GetMQTT(ctx ttnlog.Interface, accessKey string) mqtt.Client { username, password, err := getMQTTCredentials(ctx, accessKey) if err != nil { ctx.WithError(err).Fatal("Failed to get MQTT credentials") } mqttProto := "tcp" if strings.HasSuffix(viper.GetString("mqtt-address"), ":8883") { mqttProto = "ssl" ctx.Fatal("TLS connections are not yet supported by ttnctl") } broker := fmt.Sprintf("%s://%s", mqttProto, viper.GetString("mqtt-address")) client := mqtt.NewClient(ctx, "ttnctl", username, password, broker) ctx.WithFields(ttnlog.Fields{ "MQTT Broker": broker, "Username": username, }).Info("Connecting to MQTT...") if err := client.Connect(); err != nil { ctx.WithError(err).Fatal("Could not connect") } return client }
[ "func", "GetMQTT", "(", "ctx", "ttnlog", ".", "Interface", ",", "accessKey", "string", ")", "mqtt", ".", "Client", "{", "username", ",", "password", ",", "err", ":=", "getMQTTCredentials", "(", "ctx", ",", "accessKey", ")", "\n", "if", "err", "!=", "nil", "{", "ctx", ".", "WithError", "(", "err", ")", ".", "Fatal", "(", "\"", "\"", ")", "\n", "}", "\n\n", "mqttProto", ":=", "\"", "\"", "\n", "if", "strings", ".", "HasSuffix", "(", "viper", ".", "GetString", "(", "\"", "\"", ")", ",", "\"", "\"", ")", "{", "mqttProto", "=", "\"", "\"", "\n", "ctx", ".", "Fatal", "(", "\"", "\"", ")", "\n", "}", "\n", "broker", ":=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "mqttProto", ",", "viper", ".", "GetString", "(", "\"", "\"", ")", ")", "\n", "client", ":=", "mqtt", ".", "NewClient", "(", "ctx", ",", "\"", "\"", ",", "username", ",", "password", ",", "broker", ")", "\n\n", "ctx", ".", "WithFields", "(", "ttnlog", ".", "Fields", "{", "\"", "\"", ":", "broker", ",", "\"", "\"", ":", "username", ",", "}", ")", ".", "Info", "(", "\"", "\"", ")", "\n\n", "if", "err", ":=", "client", ".", "Connect", "(", ")", ";", "err", "!=", "nil", "{", "ctx", ".", "WithError", "(", "err", ")", ".", "Fatal", "(", "\"", "\"", ")", "\n", "}", "\n\n", "return", "client", "\n", "}" ]
// GetMQTT connects a new MQTT clients with the specified credentials
[ "GetMQTT", "connects", "a", "new", "MQTT", "clients", "with", "the", "specified", "credentials" ]
fc5709a55c20e1712047e5cb5a8d571aa62eefbb
https://github.com/TheThingsNetwork/ttn/blob/fc5709a55c20e1712047e5cb5a8d571aa62eefbb/ttnctl/util/mqtt.go#L18-L42
145,104
TheThingsNetwork/ttn
core/router/gateway/gateway.go
NewGateway
func NewGateway(ctx ttnlog.Interface, id string) *Gateway { ctx = ctx.WithField("GatewayID", id) gtw := &Gateway{ ID: id, Status: NewStatusStore(), Utilization: NewUtilization(), Schedule: NewSchedule(ctx), Ctx: ctx, } gtw.Schedule.(*schedule).gateway = gtw // FIXME: Issue #420 return gtw }
go
func NewGateway(ctx ttnlog.Interface, id string) *Gateway { ctx = ctx.WithField("GatewayID", id) gtw := &Gateway{ ID: id, Status: NewStatusStore(), Utilization: NewUtilization(), Schedule: NewSchedule(ctx), Ctx: ctx, } gtw.Schedule.(*schedule).gateway = gtw // FIXME: Issue #420 return gtw }
[ "func", "NewGateway", "(", "ctx", "ttnlog", ".", "Interface", ",", "id", "string", ")", "*", "Gateway", "{", "ctx", "=", "ctx", ".", "WithField", "(", "\"", "\"", ",", "id", ")", "\n", "gtw", ":=", "&", "Gateway", "{", "ID", ":", "id", ",", "Status", ":", "NewStatusStore", "(", ")", ",", "Utilization", ":", "NewUtilization", "(", ")", ",", "Schedule", ":", "NewSchedule", "(", "ctx", ")", ",", "Ctx", ":", "ctx", ",", "}", "\n", "gtw", ".", "Schedule", ".", "(", "*", "schedule", ")", ".", "gateway", "=", "gtw", "// FIXME: Issue #420", "\n", "return", "gtw", "\n", "}" ]
// NewGateway creates a new in-memory Gateway structure
[ "NewGateway", "creates", "a", "new", "in", "-", "memory", "Gateway", "structure" ]
fc5709a55c20e1712047e5cb5a8d571aa62eefbb
https://github.com/TheThingsNetwork/ttn/blob/fc5709a55c20e1712047e5cb5a8d571aa62eefbb/core/router/gateway/gateway.go#L19-L30
145,105
TheThingsNetwork/ttn
utils/security/jwt.go
BuildJWT
func BuildJWT(subject string, ttl time.Duration, privateKey []byte) (token string, err error) { claims := jwt.StandardClaims{ Issuer: subject, Subject: subject, IssuedAt: time.Now().Add(-20 * time.Second).Unix(), NotBefore: time.Now().Add(-20 * time.Second).Unix(), } if ttl > 0 { claims.ExpiresAt = time.Now().Add(ttl).Unix() } tokenBuilder := jwt.NewWithClaims(jwt.SigningMethodES256, claims) var key *ecdsa.PrivateKey key, err = jwt.ParseECPrivateKeyFromPEM(privateKey) if err != nil { return } token, err = tokenBuilder.SignedString(key) if err != nil { return } return }
go
func BuildJWT(subject string, ttl time.Duration, privateKey []byte) (token string, err error) { claims := jwt.StandardClaims{ Issuer: subject, Subject: subject, IssuedAt: time.Now().Add(-20 * time.Second).Unix(), NotBefore: time.Now().Add(-20 * time.Second).Unix(), } if ttl > 0 { claims.ExpiresAt = time.Now().Add(ttl).Unix() } tokenBuilder := jwt.NewWithClaims(jwt.SigningMethodES256, claims) var key *ecdsa.PrivateKey key, err = jwt.ParseECPrivateKeyFromPEM(privateKey) if err != nil { return } token, err = tokenBuilder.SignedString(key) if err != nil { return } return }
[ "func", "BuildJWT", "(", "subject", "string", ",", "ttl", "time", ".", "Duration", ",", "privateKey", "[", "]", "byte", ")", "(", "token", "string", ",", "err", "error", ")", "{", "claims", ":=", "jwt", ".", "StandardClaims", "{", "Issuer", ":", "subject", ",", "Subject", ":", "subject", ",", "IssuedAt", ":", "time", ".", "Now", "(", ")", ".", "Add", "(", "-", "20", "*", "time", ".", "Second", ")", ".", "Unix", "(", ")", ",", "NotBefore", ":", "time", ".", "Now", "(", ")", ".", "Add", "(", "-", "20", "*", "time", ".", "Second", ")", ".", "Unix", "(", ")", ",", "}", "\n", "if", "ttl", ">", "0", "{", "claims", ".", "ExpiresAt", "=", "time", ".", "Now", "(", ")", ".", "Add", "(", "ttl", ")", ".", "Unix", "(", ")", "\n", "}", "\n", "tokenBuilder", ":=", "jwt", ".", "NewWithClaims", "(", "jwt", ".", "SigningMethodES256", ",", "claims", ")", "\n", "var", "key", "*", "ecdsa", ".", "PrivateKey", "\n", "key", ",", "err", "=", "jwt", ".", "ParseECPrivateKeyFromPEM", "(", "privateKey", ")", "\n", "if", "err", "!=", "nil", "{", "return", "\n", "}", "\n", "token", ",", "err", "=", "tokenBuilder", ".", "SignedString", "(", "key", ")", "\n", "if", "err", "!=", "nil", "{", "return", "\n", "}", "\n", "return", "\n", "}" ]
// BuildJWT builds a JSON Web Token for the given subject and ttl, and signs it with the given private key
[ "BuildJWT", "builds", "a", "JSON", "Web", "Token", "for", "the", "given", "subject", "and", "ttl", "and", "signs", "it", "with", "the", "given", "private", "key" ]
fc5709a55c20e1712047e5cb5a8d571aa62eefbb
https://github.com/TheThingsNetwork/ttn/blob/fc5709a55c20e1712047e5cb5a8d571aa62eefbb/utils/security/jwt.go#L15-L36
145,106
TheThingsNetwork/ttn
utils/security/jwt.go
ValidateJWT
func ValidateJWT(token string, publicKey []byte) (*jwt.StandardClaims, error) { claims := &jwt.StandardClaims{} _, err := jwt.ParseWithClaims(token, claims, func(token *jwt.Token) (interface{}, error) { if _, ok := token.Method.(*jwt.SigningMethodECDSA); !ok { return nil, fmt.Errorf("Unexpected JWT signing method: %v", token.Header["alg"]) } key, err := jwt.ParseECPublicKeyFromPEM(publicKey) if err != nil { return nil, err } return key, nil }) if err != nil { return nil, fmt.Errorf("Unable to verify JWT: %s", err.Error()) } return claims, nil }
go
func ValidateJWT(token string, publicKey []byte) (*jwt.StandardClaims, error) { claims := &jwt.StandardClaims{} _, err := jwt.ParseWithClaims(token, claims, func(token *jwt.Token) (interface{}, error) { if _, ok := token.Method.(*jwt.SigningMethodECDSA); !ok { return nil, fmt.Errorf("Unexpected JWT signing method: %v", token.Header["alg"]) } key, err := jwt.ParseECPublicKeyFromPEM(publicKey) if err != nil { return nil, err } return key, nil }) if err != nil { return nil, fmt.Errorf("Unable to verify JWT: %s", err.Error()) } return claims, nil }
[ "func", "ValidateJWT", "(", "token", "string", ",", "publicKey", "[", "]", "byte", ")", "(", "*", "jwt", ".", "StandardClaims", ",", "error", ")", "{", "claims", ":=", "&", "jwt", ".", "StandardClaims", "{", "}", "\n", "_", ",", "err", ":=", "jwt", ".", "ParseWithClaims", "(", "token", ",", "claims", ",", "func", "(", "token", "*", "jwt", ".", "Token", ")", "(", "interface", "{", "}", ",", "error", ")", "{", "if", "_", ",", "ok", ":=", "token", ".", "Method", ".", "(", "*", "jwt", ".", "SigningMethodECDSA", ")", ";", "!", "ok", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "token", ".", "Header", "[", "\"", "\"", "]", ")", "\n", "}", "\n", "key", ",", "err", ":=", "jwt", ".", "ParseECPublicKeyFromPEM", "(", "publicKey", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "key", ",", "nil", "\n", "}", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ".", "Error", "(", ")", ")", "\n", "}", "\n", "return", "claims", ",", "nil", "\n", "}" ]
// ValidateJWT validates a JSON Web Token with the given public key
[ "ValidateJWT", "validates", "a", "JSON", "Web", "Token", "with", "the", "given", "public", "key" ]
fc5709a55c20e1712047e5cb5a8d571aa62eefbb
https://github.com/TheThingsNetwork/ttn/blob/fc5709a55c20e1712047e5cb5a8d571aa62eefbb/utils/security/jwt.go#L39-L55
145,107
TheThingsNetwork/ttn
utils/fcnt/fcnt.go
GetFull
func GetFull(full uint32, lsb uint16) uint32 { if int(lsb)-int(full) > 0 { return uint32(lsb) } if uint16(full%maxUint16) <= lsb { return uint32(lsb) + (full/maxUint16)*maxUint16 } return uint32(lsb) + ((full/maxUint16)+1)*maxUint16 }
go
func GetFull(full uint32, lsb uint16) uint32 { if int(lsb)-int(full) > 0 { return uint32(lsb) } if uint16(full%maxUint16) <= lsb { return uint32(lsb) + (full/maxUint16)*maxUint16 } return uint32(lsb) + ((full/maxUint16)+1)*maxUint16 }
[ "func", "GetFull", "(", "full", "uint32", ",", "lsb", "uint16", ")", "uint32", "{", "if", "int", "(", "lsb", ")", "-", "int", "(", "full", ")", ">", "0", "{", "return", "uint32", "(", "lsb", ")", "\n", "}", "\n", "if", "uint16", "(", "full", "%", "maxUint16", ")", "<=", "lsb", "{", "return", "uint32", "(", "lsb", ")", "+", "(", "full", "/", "maxUint16", ")", "*", "maxUint16", "\n", "}", "\n", "return", "uint32", "(", "lsb", ")", "+", "(", "(", "full", "/", "maxUint16", ")", "+", "1", ")", "*", "maxUint16", "\n", "}" ]
// GetFull calculates the full 32-bit frame counter
[ "GetFull", "calculates", "the", "full", "32", "-", "bit", "frame", "counter" ]
fc5709a55c20e1712047e5cb5a8d571aa62eefbb
https://github.com/TheThingsNetwork/ttn/blob/fc5709a55c20e1712047e5cb5a8d571aa62eefbb/utils/fcnt/fcnt.go#L9-L17
145,108
TheThingsNetwork/ttn
core/types/dev_addr.go
ParseDevAddr
func ParseDevAddr(input string) (addr DevAddr, err error) { bytes, err := ParseHEX(input, 4) if err != nil { return } copy(addr[:], bytes) return }
go
func ParseDevAddr(input string) (addr DevAddr, err error) { bytes, err := ParseHEX(input, 4) if err != nil { return } copy(addr[:], bytes) return }
[ "func", "ParseDevAddr", "(", "input", "string", ")", "(", "addr", "DevAddr", ",", "err", "error", ")", "{", "bytes", ",", "err", ":=", "ParseHEX", "(", "input", ",", "4", ")", "\n", "if", "err", "!=", "nil", "{", "return", "\n", "}", "\n", "copy", "(", "addr", "[", ":", "]", ",", "bytes", ")", "\n", "return", "\n", "}" ]
// ParseDevAddr parses a 32-bit hex-encoded string to a DevAddr
[ "ParseDevAddr", "parses", "a", "32", "-", "bit", "hex", "-", "encoded", "string", "to", "a", "DevAddr" ]
fc5709a55c20e1712047e5cb5a8d571aa62eefbb
https://github.com/TheThingsNetwork/ttn/blob/fc5709a55c20e1712047e5cb5a8d571aa62eefbb/core/types/dev_addr.go#L20-L27
145,109
TheThingsNetwork/ttn
core/types/dev_addr.go
Bytes
func (prefix DevAddrPrefix) Bytes() (bytes []byte) { bytes = append(bytes, byte(prefix.Length)) bytes = append(bytes, prefix.DevAddr.Bytes()...) return bytes }
go
func (prefix DevAddrPrefix) Bytes() (bytes []byte) { bytes = append(bytes, byte(prefix.Length)) bytes = append(bytes, prefix.DevAddr.Bytes()...) return bytes }
[ "func", "(", "prefix", "DevAddrPrefix", ")", "Bytes", "(", ")", "(", "bytes", "[", "]", "byte", ")", "{", "bytes", "=", "append", "(", "bytes", ",", "byte", "(", "prefix", ".", "Length", ")", ")", "\n", "bytes", "=", "append", "(", "bytes", ",", "prefix", ".", "DevAddr", ".", "Bytes", "(", ")", "...", ")", "\n", "return", "bytes", "\n", "}" ]
// Bytes returns the DevAddrPrefix as a byte slice
[ "Bytes", "returns", "the", "DevAddrPrefix", "as", "a", "byte", "slice" ]
fc5709a55c20e1712047e5cb5a8d571aa62eefbb
https://github.com/TheThingsNetwork/ttn/blob/fc5709a55c20e1712047e5cb5a8d571aa62eefbb/core/types/dev_addr.go#L130-L134
145,110
TheThingsNetwork/ttn
core/types/dev_addr.go
String
func (prefix DevAddrPrefix) String() string { var addr string if prefix.DevAddr.IsEmpty() { addr = "00000000" } else { addr = prefix.DevAddr.String() } return fmt.Sprintf("%s/%d", addr, prefix.Length) }
go
func (prefix DevAddrPrefix) String() string { var addr string if prefix.DevAddr.IsEmpty() { addr = "00000000" } else { addr = prefix.DevAddr.String() } return fmt.Sprintf("%s/%d", addr, prefix.Length) }
[ "func", "(", "prefix", "DevAddrPrefix", ")", "String", "(", ")", "string", "{", "var", "addr", "string", "\n", "if", "prefix", ".", "DevAddr", ".", "IsEmpty", "(", ")", "{", "addr", "=", "\"", "\"", "\n", "}", "else", "{", "addr", "=", "prefix", ".", "DevAddr", ".", "String", "(", ")", "\n", "}", "\n", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "addr", ",", "prefix", ".", "Length", ")", "\n", "}" ]
// String implements the fmt.Stringer interface
[ "String", "implements", "the", "fmt", ".", "Stringer", "interface" ]
fc5709a55c20e1712047e5cb5a8d571aa62eefbb
https://github.com/TheThingsNetwork/ttn/blob/fc5709a55c20e1712047e5cb5a8d571aa62eefbb/core/types/dev_addr.go#L137-L145
145,111
TheThingsNetwork/ttn
core/types/dev_addr.go
Mask
func (addr DevAddr) Mask(bits int) (masked DevAddr) { return empty.WithPrefix(DevAddrPrefix{addr, bits}) }
go
func (addr DevAddr) Mask(bits int) (masked DevAddr) { return empty.WithPrefix(DevAddrPrefix{addr, bits}) }
[ "func", "(", "addr", "DevAddr", ")", "Mask", "(", "bits", "int", ")", "(", "masked", "DevAddr", ")", "{", "return", "empty", ".", "WithPrefix", "(", "DevAddrPrefix", "{", "addr", ",", "bits", "}", ")", "\n", "}" ]
// Mask returns a copy of the DevAddr with only the first "bits" bits
[ "Mask", "returns", "a", "copy", "of", "the", "DevAddr", "with", "only", "the", "first", "bits", "bits" ]
fc5709a55c20e1712047e5cb5a8d571aa62eefbb
https://github.com/TheThingsNetwork/ttn/blob/fc5709a55c20e1712047e5cb5a8d571aa62eefbb/core/types/dev_addr.go#L202-L204
145,112
TheThingsNetwork/ttn
core/types/dev_addr.go
WithPrefix
func (addr DevAddr) WithPrefix(prefix DevAddrPrefix) (prefixed DevAddr) { k := uint(prefix.Length) for i := 0; i < 4; i++ { if k >= 8 { prefixed[i] = prefix.DevAddr[i] & 0xff k -= 8 continue } prefixed[i] = (prefix.DevAddr[i] & ^byte(0xff>>k)) | (addr[i] & byte(0xff>>k)) k = 0 } return }
go
func (addr DevAddr) WithPrefix(prefix DevAddrPrefix) (prefixed DevAddr) { k := uint(prefix.Length) for i := 0; i < 4; i++ { if k >= 8 { prefixed[i] = prefix.DevAddr[i] & 0xff k -= 8 continue } prefixed[i] = (prefix.DevAddr[i] & ^byte(0xff>>k)) | (addr[i] & byte(0xff>>k)) k = 0 } return }
[ "func", "(", "addr", "DevAddr", ")", "WithPrefix", "(", "prefix", "DevAddrPrefix", ")", "(", "prefixed", "DevAddr", ")", "{", "k", ":=", "uint", "(", "prefix", ".", "Length", ")", "\n", "for", "i", ":=", "0", ";", "i", "<", "4", ";", "i", "++", "{", "if", "k", ">=", "8", "{", "prefixed", "[", "i", "]", "=", "prefix", ".", "DevAddr", "[", "i", "]", "&", "0xff", "\n", "k", "-=", "8", "\n", "continue", "\n", "}", "\n", "prefixed", "[", "i", "]", "=", "(", "prefix", ".", "DevAddr", "[", "i", "]", "&", "^", "byte", "(", "0xff", ">>", "k", ")", ")", "|", "(", "addr", "[", "i", "]", "&", "byte", "(", "0xff", ">>", "k", ")", ")", "\n", "k", "=", "0", "\n", "}", "\n", "return", "\n", "}" ]
// WithPrefix returns the DevAddr, but with the first length bits replaced by the Prefix
[ "WithPrefix", "returns", "the", "DevAddr", "but", "with", "the", "first", "length", "bits", "replaced", "by", "the", "Prefix" ]
fc5709a55c20e1712047e5cb5a8d571aa62eefbb
https://github.com/TheThingsNetwork/ttn/blob/fc5709a55c20e1712047e5cb5a8d571aa62eefbb/core/types/dev_addr.go#L207-L219
145,113
TheThingsNetwork/ttn
core/types/dev_addr.go
HasPrefix
func (addr DevAddr) HasPrefix(prefix DevAddrPrefix) bool { return addr.Mask(prefix.Length) == prefix.DevAddr.Mask(prefix.Length) }
go
func (addr DevAddr) HasPrefix(prefix DevAddrPrefix) bool { return addr.Mask(prefix.Length) == prefix.DevAddr.Mask(prefix.Length) }
[ "func", "(", "addr", "DevAddr", ")", "HasPrefix", "(", "prefix", "DevAddrPrefix", ")", "bool", "{", "return", "addr", ".", "Mask", "(", "prefix", ".", "Length", ")", "==", "prefix", ".", "DevAddr", ".", "Mask", "(", "prefix", ".", "Length", ")", "\n", "}" ]
// HasPrefix returns true if the DevAddr has a prefix of given length
[ "HasPrefix", "returns", "true", "if", "the", "DevAddr", "has", "a", "prefix", "of", "given", "length" ]
fc5709a55c20e1712047e5cb5a8d571aa62eefbb
https://github.com/TheThingsNetwork/ttn/blob/fc5709a55c20e1712047e5cb5a8d571aa62eefbb/core/types/dev_addr.go#L222-L224
145,114
minio/sio
reader-v1.go
encryptReaderV10
func encryptReaderV10(src io.Reader, config *Config) (*encReaderV10, error) { ae, err := newAuthEncV10(config) if err != nil { return nil, err } return &encReaderV10{ authEncV10: ae, src: src, buffer: make(packageV10, maxPackageSize), payloadSize: config.PayloadSize, }, nil }
go
func encryptReaderV10(src io.Reader, config *Config) (*encReaderV10, error) { ae, err := newAuthEncV10(config) if err != nil { return nil, err } return &encReaderV10{ authEncV10: ae, src: src, buffer: make(packageV10, maxPackageSize), payloadSize: config.PayloadSize, }, nil }
[ "func", "encryptReaderV10", "(", "src", "io", ".", "Reader", ",", "config", "*", "Config", ")", "(", "*", "encReaderV10", ",", "error", ")", "{", "ae", ",", "err", ":=", "newAuthEncV10", "(", "config", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "&", "encReaderV10", "{", "authEncV10", ":", "ae", ",", "src", ":", "src", ",", "buffer", ":", "make", "(", "packageV10", ",", "maxPackageSize", ")", ",", "payloadSize", ":", "config", ".", "PayloadSize", ",", "}", ",", "nil", "\n", "}" ]
// encryptReaderV10 returns an io.Reader wrapping the given io.Reader. // The returned io.Reader encrypts everything it reads using DARE 1.0.
[ "encryptReaderV10", "returns", "an", "io", ".", "Reader", "wrapping", "the", "given", "io", ".", "Reader", ".", "The", "returned", "io", ".", "Reader", "encrypts", "everything", "it", "reads", "using", "DARE", "1", ".", "0", "." ]
035b4ef8c449ba2ba21ec143c91964e76a1fb68c
https://github.com/minio/sio/blob/035b4ef8c449ba2ba21ec143c91964e76a1fb68c/reader-v1.go#L30-L41
145,115
minio/sio
reader-v1.go
decryptReaderV10
func decryptReaderV10(src io.Reader, config *Config) (*decReaderV10, error) { ad, err := newAuthDecV10(config) if err != nil { return nil, err } return &decReaderV10{ authDecV10: ad, src: src, buffer: make(packageV10, maxPackageSize), }, nil }
go
func decryptReaderV10(src io.Reader, config *Config) (*decReaderV10, error) { ad, err := newAuthDecV10(config) if err != nil { return nil, err } return &decReaderV10{ authDecV10: ad, src: src, buffer: make(packageV10, maxPackageSize), }, nil }
[ "func", "decryptReaderV10", "(", "src", "io", ".", "Reader", ",", "config", "*", "Config", ")", "(", "*", "decReaderV10", ",", "error", ")", "{", "ad", ",", "err", ":=", "newAuthDecV10", "(", "config", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "&", "decReaderV10", "{", "authDecV10", ":", "ad", ",", "src", ":", "src", ",", "buffer", ":", "make", "(", "packageV10", ",", "maxPackageSize", ")", ",", "}", ",", "nil", "\n", "}" ]
// decryptReaderV10 returns an io.Reader wrapping the given io.Reader. // The returned io.Reader decrypts everything it reads using DARE 1.0.
[ "decryptReaderV10", "returns", "an", "io", ".", "Reader", "wrapping", "the", "given", "io", ".", "Reader", ".", "The", "returned", "io", ".", "Reader", "decrypts", "everything", "it", "reads", "using", "DARE", "1", ".", "0", "." ]
035b4ef8c449ba2ba21ec143c91964e76a1fb68c
https://github.com/minio/sio/blob/035b4ef8c449ba2ba21ec143c91964e76a1fb68c/reader-v1.go#L91-L101
145,116
minio/sio
sio.go
Encrypt
func Encrypt(dst io.Writer, src io.Reader, config Config) (n int64, err error) { encReader, err := EncryptReader(src, config) if err != nil { return 0, err } return io.CopyBuffer(dst, encReader, make([]byte, headerSize+maxPayloadSize+tagSize)) }
go
func Encrypt(dst io.Writer, src io.Reader, config Config) (n int64, err error) { encReader, err := EncryptReader(src, config) if err != nil { return 0, err } return io.CopyBuffer(dst, encReader, make([]byte, headerSize+maxPayloadSize+tagSize)) }
[ "func", "Encrypt", "(", "dst", "io", ".", "Writer", ",", "src", "io", ".", "Reader", ",", "config", "Config", ")", "(", "n", "int64", ",", "err", "error", ")", "{", "encReader", ",", "err", ":=", "EncryptReader", "(", "src", ",", "config", ")", "\n", "if", "err", "!=", "nil", "{", "return", "0", ",", "err", "\n", "}", "\n", "return", "io", ".", "CopyBuffer", "(", "dst", ",", "encReader", ",", "make", "(", "[", "]", "byte", ",", "headerSize", "+", "maxPayloadSize", "+", "tagSize", ")", ")", "\n", "}" ]
// Encrypt reads from src until it encounters an io.EOF and encrypts all received // data. The encrypted data is written to dst. It returns the number of bytes // encrypted and the first error encountered while encrypting, if any. // // Encrypt returns the number of bytes written to dst.
[ "Encrypt", "reads", "from", "src", "until", "it", "encounters", "an", "io", ".", "EOF", "and", "encrypts", "all", "received", "data", ".", "The", "encrypted", "data", "is", "written", "to", "dst", ".", "It", "returns", "the", "number", "of", "bytes", "encrypted", "and", "the", "first", "error", "encountered", "while", "encrypting", "if", "any", ".", "Encrypt", "returns", "the", "number", "of", "bytes", "written", "to", "dst", "." ]
035b4ef8c449ba2ba21ec143c91964e76a1fb68c
https://github.com/minio/sio/blob/035b4ef8c449ba2ba21ec143c91964e76a1fb68c/sio.go#L174-L180
145,117
minio/sio
sio.go
Decrypt
func Decrypt(dst io.Writer, src io.Reader, config Config) (n int64, err error) { decReader, err := DecryptReader(src, config) if err != nil { return 0, err } return io.CopyBuffer(dst, decReader, make([]byte, maxPayloadSize)) }
go
func Decrypt(dst io.Writer, src io.Reader, config Config) (n int64, err error) { decReader, err := DecryptReader(src, config) if err != nil { return 0, err } return io.CopyBuffer(dst, decReader, make([]byte, maxPayloadSize)) }
[ "func", "Decrypt", "(", "dst", "io", ".", "Writer", ",", "src", "io", ".", "Reader", ",", "config", "Config", ")", "(", "n", "int64", ",", "err", "error", ")", "{", "decReader", ",", "err", ":=", "DecryptReader", "(", "src", ",", "config", ")", "\n", "if", "err", "!=", "nil", "{", "return", "0", ",", "err", "\n", "}", "\n", "return", "io", ".", "CopyBuffer", "(", "dst", ",", "decReader", ",", "make", "(", "[", "]", "byte", ",", "maxPayloadSize", ")", ")", "\n", "}" ]
// Decrypt reads from src until it encounters an io.EOF and decrypts all received // data. The decrypted data is written to dst. It returns the number of bytes // decrypted and the first error encountered while decrypting, if any. // // Decrypt returns the number of bytes written to dst. Decrypt only writes data to // dst if the data was decrypted successfully. It returns an error of type sio.Error // if decryption fails.
[ "Decrypt", "reads", "from", "src", "until", "it", "encounters", "an", "io", ".", "EOF", "and", "decrypts", "all", "received", "data", ".", "The", "decrypted", "data", "is", "written", "to", "dst", ".", "It", "returns", "the", "number", "of", "bytes", "decrypted", "and", "the", "first", "error", "encountered", "while", "decrypting", "if", "any", ".", "Decrypt", "returns", "the", "number", "of", "bytes", "written", "to", "dst", ".", "Decrypt", "only", "writes", "data", "to", "dst", "if", "the", "data", "was", "decrypted", "successfully", ".", "It", "returns", "an", "error", "of", "type", "sio", ".", "Error", "if", "decryption", "fails", "." ]
035b4ef8c449ba2ba21ec143c91964e76a1fb68c
https://github.com/minio/sio/blob/035b4ef8c449ba2ba21ec143c91964e76a1fb68c/sio.go#L189-L195
145,118
minio/sio
sio.go
EncryptReader
func EncryptReader(src io.Reader, config Config) (io.Reader, error) { if err := setConfigDefaults(&config); err != nil { return nil, err } if config.MaxVersion == Version20 { return encryptReaderV20(src, &config) } return encryptReaderV10(src, &config) }
go
func EncryptReader(src io.Reader, config Config) (io.Reader, error) { if err := setConfigDefaults(&config); err != nil { return nil, err } if config.MaxVersion == Version20 { return encryptReaderV20(src, &config) } return encryptReaderV10(src, &config) }
[ "func", "EncryptReader", "(", "src", "io", ".", "Reader", ",", "config", "Config", ")", "(", "io", ".", "Reader", ",", "error", ")", "{", "if", "err", ":=", "setConfigDefaults", "(", "&", "config", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "if", "config", ".", "MaxVersion", "==", "Version20", "{", "return", "encryptReaderV20", "(", "src", ",", "&", "config", ")", "\n", "}", "\n", "return", "encryptReaderV10", "(", "src", ",", "&", "config", ")", "\n", "}" ]
// EncryptReader wraps the given src and returns an io.Reader which encrypts // all received data. EncryptReader returns an error if the provided encryption // configuration is invalid.
[ "EncryptReader", "wraps", "the", "given", "src", "and", "returns", "an", "io", ".", "Reader", "which", "encrypts", "all", "received", "data", ".", "EncryptReader", "returns", "an", "error", "if", "the", "provided", "encryption", "configuration", "is", "invalid", "." ]
035b4ef8c449ba2ba21ec143c91964e76a1fb68c
https://github.com/minio/sio/blob/035b4ef8c449ba2ba21ec143c91964e76a1fb68c/sio.go#L200-L208
145,119
minio/sio
sio.go
DecryptReader
func DecryptReader(src io.Reader, config Config) (io.Reader, error) { if err := setConfigDefaults(&config); err != nil { return nil, err } if config.MinVersion == Version10 && config.MaxVersion == Version10 { return decryptReaderV10(src, &config) } if config.MinVersion == Version20 && config.MaxVersion == Version20 { return decryptReaderV20(src, &config) } return decryptReader(src, &config), nil }
go
func DecryptReader(src io.Reader, config Config) (io.Reader, error) { if err := setConfigDefaults(&config); err != nil { return nil, err } if config.MinVersion == Version10 && config.MaxVersion == Version10 { return decryptReaderV10(src, &config) } if config.MinVersion == Version20 && config.MaxVersion == Version20 { return decryptReaderV20(src, &config) } return decryptReader(src, &config), nil }
[ "func", "DecryptReader", "(", "src", "io", ".", "Reader", ",", "config", "Config", ")", "(", "io", ".", "Reader", ",", "error", ")", "{", "if", "err", ":=", "setConfigDefaults", "(", "&", "config", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "if", "config", ".", "MinVersion", "==", "Version10", "&&", "config", ".", "MaxVersion", "==", "Version10", "{", "return", "decryptReaderV10", "(", "src", ",", "&", "config", ")", "\n", "}", "\n", "if", "config", ".", "MinVersion", "==", "Version20", "&&", "config", ".", "MaxVersion", "==", "Version20", "{", "return", "decryptReaderV20", "(", "src", ",", "&", "config", ")", "\n", "}", "\n", "return", "decryptReader", "(", "src", ",", "&", "config", ")", ",", "nil", "\n", "}" ]
// DecryptReader wraps the given src and returns an io.Reader which decrypts // all received data. DecryptReader returns an error if the provided decryption // configuration is invalid. The returned io.Reader returns an error of // type sio.Error if the decryption fails.
[ "DecryptReader", "wraps", "the", "given", "src", "and", "returns", "an", "io", ".", "Reader", "which", "decrypts", "all", "received", "data", ".", "DecryptReader", "returns", "an", "error", "if", "the", "provided", "decryption", "configuration", "is", "invalid", ".", "The", "returned", "io", ".", "Reader", "returns", "an", "error", "of", "type", "sio", ".", "Error", "if", "the", "decryption", "fails", "." ]
035b4ef8c449ba2ba21ec143c91964e76a1fb68c
https://github.com/minio/sio/blob/035b4ef8c449ba2ba21ec143c91964e76a1fb68c/sio.go#L214-L225
145,120
minio/sio
sio.go
EncryptWriter
func EncryptWriter(dst io.Writer, config Config) (io.WriteCloser, error) { if err := setConfigDefaults(&config); err != nil { return nil, err } if config.MaxVersion == Version20 { return encryptWriterV20(dst, &config) } return encryptWriterV10(dst, &config) }
go
func EncryptWriter(dst io.Writer, config Config) (io.WriteCloser, error) { if err := setConfigDefaults(&config); err != nil { return nil, err } if config.MaxVersion == Version20 { return encryptWriterV20(dst, &config) } return encryptWriterV10(dst, &config) }
[ "func", "EncryptWriter", "(", "dst", "io", ".", "Writer", ",", "config", "Config", ")", "(", "io", ".", "WriteCloser", ",", "error", ")", "{", "if", "err", ":=", "setConfigDefaults", "(", "&", "config", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "if", "config", ".", "MaxVersion", "==", "Version20", "{", "return", "encryptWriterV20", "(", "dst", ",", "&", "config", ")", "\n", "}", "\n", "return", "encryptWriterV10", "(", "dst", ",", "&", "config", ")", "\n", "}" ]
// EncryptWriter wraps the given dst and returns an io.WriteCloser which // encrypts all data written to it. EncryptWriter returns an error if the // provided decryption configuration is invalid. // // The returned io.WriteCloser must be closed successfully to finalize the // encryption process.
[ "EncryptWriter", "wraps", "the", "given", "dst", "and", "returns", "an", "io", ".", "WriteCloser", "which", "encrypts", "all", "data", "written", "to", "it", ".", "EncryptWriter", "returns", "an", "error", "if", "the", "provided", "decryption", "configuration", "is", "invalid", ".", "The", "returned", "io", ".", "WriteCloser", "must", "be", "closed", "successfully", "to", "finalize", "the", "encryption", "process", "." ]
035b4ef8c449ba2ba21ec143c91964e76a1fb68c
https://github.com/minio/sio/blob/035b4ef8c449ba2ba21ec143c91964e76a1fb68c/sio.go#L233-L241
145,121
minio/sio
sio.go
DecryptWriter
func DecryptWriter(dst io.Writer, config Config) (io.WriteCloser, error) { if err := setConfigDefaults(&config); err != nil { return nil, err } if config.MinVersion == Version10 && config.MaxVersion == Version10 { return decryptWriterV10(dst, &config) } if config.MinVersion == Version20 && config.MaxVersion == Version20 { return decryptWriterV20(dst, &config) } return decryptWriter(dst, &config), nil }
go
func DecryptWriter(dst io.Writer, config Config) (io.WriteCloser, error) { if err := setConfigDefaults(&config); err != nil { return nil, err } if config.MinVersion == Version10 && config.MaxVersion == Version10 { return decryptWriterV10(dst, &config) } if config.MinVersion == Version20 && config.MaxVersion == Version20 { return decryptWriterV20(dst, &config) } return decryptWriter(dst, &config), nil }
[ "func", "DecryptWriter", "(", "dst", "io", ".", "Writer", ",", "config", "Config", ")", "(", "io", ".", "WriteCloser", ",", "error", ")", "{", "if", "err", ":=", "setConfigDefaults", "(", "&", "config", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "if", "config", ".", "MinVersion", "==", "Version10", "&&", "config", ".", "MaxVersion", "==", "Version10", "{", "return", "decryptWriterV10", "(", "dst", ",", "&", "config", ")", "\n", "}", "\n", "if", "config", ".", "MinVersion", "==", "Version20", "&&", "config", ".", "MaxVersion", "==", "Version20", "{", "return", "decryptWriterV20", "(", "dst", ",", "&", "config", ")", "\n", "}", "\n", "return", "decryptWriter", "(", "dst", ",", "&", "config", ")", ",", "nil", "\n", "}" ]
// DecryptWriter wraps the given dst and returns an io.WriteCloser which // decrypts all data written to it. DecryptWriter returns an error if the // provided decryption configuration is invalid. // // The returned io.WriteCloser must be closed successfully to finalize the // decryption process. The returned io.WriteCloser returns an error of // type sio.Error if the decryption fails.
[ "DecryptWriter", "wraps", "the", "given", "dst", "and", "returns", "an", "io", ".", "WriteCloser", "which", "decrypts", "all", "data", "written", "to", "it", ".", "DecryptWriter", "returns", "an", "error", "if", "the", "provided", "decryption", "configuration", "is", "invalid", ".", "The", "returned", "io", ".", "WriteCloser", "must", "be", "closed", "successfully", "to", "finalize", "the", "decryption", "process", ".", "The", "returned", "io", ".", "WriteCloser", "returns", "an", "error", "of", "type", "sio", ".", "Error", "if", "the", "decryption", "fails", "." ]
035b4ef8c449ba2ba21ec143c91964e76a1fb68c
https://github.com/minio/sio/blob/035b4ef8c449ba2ba21ec143c91964e76a1fb68c/sio.go#L250-L261
145,122
minio/sio
generic.go
decryptWriter
func decryptWriter(w io.Writer, config *Config) *decWriter { return &decWriter{ config: *config, dst: w, firstWrite: true, } }
go
func decryptWriter(w io.Writer, config *Config) *decWriter { return &decWriter{ config: *config, dst: w, firstWrite: true, } }
[ "func", "decryptWriter", "(", "w", "io", ".", "Writer", ",", "config", "*", "Config", ")", "*", "decWriter", "{", "return", "&", "decWriter", "{", "config", ":", "*", "config", ",", "dst", ":", "w", ",", "firstWrite", ":", "true", ",", "}", "\n", "}" ]
// decryptWriter returns an io.WriteCloser wrapping the given io.Writer. // The returned io.WriteCloser detects whether the data written to it is // encrypted using DARE 1.0 or 2.0 and decrypts it using the correct DARE // version.
[ "decryptWriter", "returns", "an", "io", ".", "WriteCloser", "wrapping", "the", "given", "io", ".", "Writer", ".", "The", "returned", "io", ".", "WriteCloser", "detects", "whether", "the", "data", "written", "to", "it", "is", "encrypted", "using", "DARE", "1", ".", "0", "or", "2", ".", "0", "and", "decrypts", "it", "using", "the", "correct", "DARE", "version", "." ]
035b4ef8c449ba2ba21ec143c91964e76a1fb68c
https://github.com/minio/sio/blob/035b4ef8c449ba2ba21ec143c91964e76a1fb68c/generic.go#L33-L39
145,123
minio/sio
generic.go
decryptReader
func decryptReader(r io.Reader, config *Config) *decReader { return &decReader{ config: *config, src: r, firstRead: true, } }
go
func decryptReader(r io.Reader, config *Config) *decReader { return &decReader{ config: *config, src: r, firstRead: true, } }
[ "func", "decryptReader", "(", "r", "io", ".", "Reader", ",", "config", "*", "Config", ")", "*", "decReader", "{", "return", "&", "decReader", "{", "config", ":", "*", "config", ",", "src", ":", "r", ",", "firstRead", ":", "true", ",", "}", "\n", "}" ]
// decryptReader returns an io.Reader wrapping the given io.Reader. // The returned io.Reader detects whether the underlying io.Reader returns // DARE 1.0 or 2.0 encrypted data and decrypts it using the correct DARE version.
[ "decryptReader", "returns", "an", "io", ".", "Reader", "wrapping", "the", "given", "io", ".", "Reader", ".", "The", "returned", "io", ".", "Reader", "detects", "whether", "the", "underlying", "io", ".", "Reader", "returns", "DARE", "1", ".", "0", "or", "2", ".", "0", "encrypted", "data", "and", "decrypts", "it", "using", "the", "correct", "DARE", "version", "." ]
035b4ef8c449ba2ba21ec143c91964e76a1fb68c
https://github.com/minio/sio/blob/035b4ef8c449ba2ba21ec143c91964e76a1fb68c/generic.go#L82-L88
145,124
minio/sio
writer-v2.go
encryptWriterV20
func encryptWriterV20(dst io.Writer, config *Config) (*encWriterV20, error) { ae, err := newAuthEncV20(config) if err != nil { return nil, err } return &encWriterV20{ authEncV20: ae, dst: dst, buffer: make(packageV20, maxPackageSize), }, nil }
go
func encryptWriterV20(dst io.Writer, config *Config) (*encWriterV20, error) { ae, err := newAuthEncV20(config) if err != nil { return nil, err } return &encWriterV20{ authEncV20: ae, dst: dst, buffer: make(packageV20, maxPackageSize), }, nil }
[ "func", "encryptWriterV20", "(", "dst", "io", ".", "Writer", ",", "config", "*", "Config", ")", "(", "*", "encWriterV20", ",", "error", ")", "{", "ae", ",", "err", ":=", "newAuthEncV20", "(", "config", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "&", "encWriterV20", "{", "authEncV20", ":", "ae", ",", "dst", ":", "dst", ",", "buffer", ":", "make", "(", "packageV20", ",", "maxPackageSize", ")", ",", "}", ",", "nil", "\n", "}" ]
// encryptWriterV20 returns an io.WriteCloser wrapping the given io.Writer. // The returned io.WriteCloser encrypts everything written to it using DARE 2.0 // and writes all encrypted ciphertext as well as the package header and tag // to the wrapped io.Writer. // // The io.WriteCloser must be closed to finalize the encryption successfully.
[ "encryptWriterV20", "returns", "an", "io", ".", "WriteCloser", "wrapping", "the", "given", "io", ".", "Writer", ".", "The", "returned", "io", ".", "WriteCloser", "encrypts", "everything", "written", "to", "it", "using", "DARE", "2", ".", "0", "and", "writes", "all", "encrypted", "ciphertext", "as", "well", "as", "the", "package", "header", "and", "tag", "to", "the", "wrapped", "io", ".", "Writer", ".", "The", "io", ".", "WriteCloser", "must", "be", "closed", "to", "finalize", "the", "encryption", "successfully", "." ]
035b4ef8c449ba2ba21ec143c91964e76a1fb68c
https://github.com/minio/sio/blob/035b4ef8c449ba2ba21ec143c91964e76a1fb68c/writer-v2.go#L35-L45
145,125
minio/sio
writer-v2.go
decryptWriterV20
func decryptWriterV20(dst io.Writer, config *Config) (*decWriterV20, error) { ad, err := newAuthDecV20(config) if err != nil { return nil, err } return &decWriterV20{ authDecV20: ad, dst: dst, buffer: make(packageV20, maxPackageSize), }, nil }
go
func decryptWriterV20(dst io.Writer, config *Config) (*decWriterV20, error) { ad, err := newAuthDecV20(config) if err != nil { return nil, err } return &decWriterV20{ authDecV20: ad, dst: dst, buffer: make(packageV20, maxPackageSize), }, nil }
[ "func", "decryptWriterV20", "(", "dst", "io", ".", "Writer", ",", "config", "*", "Config", ")", "(", "*", "decWriterV20", ",", "error", ")", "{", "ad", ",", "err", ":=", "newAuthDecV20", "(", "config", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "&", "decWriterV20", "{", "authDecV20", ":", "ad", ",", "dst", ":", "dst", ",", "buffer", ":", "make", "(", "packageV20", ",", "maxPackageSize", ")", ",", "}", ",", "nil", "\n", "}" ]
// decryptWriterV20 returns an io.WriteCloser wrapping the given io.Writer. // The returned io.WriteCloser decrypts everything written to it using DARE 2.0 // and writes all decrypted plaintext to the wrapped io.Writer. // // The io.WriteCloser must be closed to finalize the decryption successfully.
[ "decryptWriterV20", "returns", "an", "io", ".", "WriteCloser", "wrapping", "the", "given", "io", ".", "Writer", ".", "The", "returned", "io", ".", "WriteCloser", "decrypts", "everything", "written", "to", "it", "using", "DARE", "2", ".", "0", "and", "writes", "all", "decrypted", "plaintext", "to", "the", "wrapped", "io", ".", "Writer", ".", "The", "io", ".", "WriteCloser", "must", "be", "closed", "to", "finalize", "the", "decryption", "successfully", "." ]
035b4ef8c449ba2ba21ec143c91964e76a1fb68c
https://github.com/minio/sio/blob/035b4ef8c449ba2ba21ec143c91964e76a1fb68c/writer-v2.go#L109-L119
145,126
minio/sio
reader-v2.go
encryptReaderV20
func encryptReaderV20(src io.Reader, config *Config) (*encReaderV20, error) { ae, err := newAuthEncV20(config) if err != nil { return nil, err } return &encReaderV20{ authEncV20: ae, src: src, buffer: make(packageV20, maxPackageSize), firstRead: true, }, nil }
go
func encryptReaderV20(src io.Reader, config *Config) (*encReaderV20, error) { ae, err := newAuthEncV20(config) if err != nil { return nil, err } return &encReaderV20{ authEncV20: ae, src: src, buffer: make(packageV20, maxPackageSize), firstRead: true, }, nil }
[ "func", "encryptReaderV20", "(", "src", "io", ".", "Reader", ",", "config", "*", "Config", ")", "(", "*", "encReaderV20", ",", "error", ")", "{", "ae", ",", "err", ":=", "newAuthEncV20", "(", "config", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "&", "encReaderV20", "{", "authEncV20", ":", "ae", ",", "src", ":", "src", ",", "buffer", ":", "make", "(", "packageV20", ",", "maxPackageSize", ")", ",", "firstRead", ":", "true", ",", "}", ",", "nil", "\n", "}" ]
// encryptReaderV20 returns an io.Reader wrapping the given io.Reader. // The returned io.Reader encrypts everything it reads using DARE 2.0.
[ "encryptReaderV20", "returns", "an", "io", ".", "Reader", "wrapping", "the", "given", "io", ".", "Reader", ".", "The", "returned", "io", ".", "Reader", "encrypts", "everything", "it", "reads", "using", "DARE", "2", ".", "0", "." ]
035b4ef8c449ba2ba21ec143c91964e76a1fb68c
https://github.com/minio/sio/blob/035b4ef8c449ba2ba21ec143c91964e76a1fb68c/reader-v2.go#L34-L45
145,127
minio/sio
reader-v2.go
decryptReaderV20
func decryptReaderV20(src io.Reader, config *Config) (*decReaderV20, error) { ad, err := newAuthDecV20(config) if err != nil { return nil, err } return &decReaderV20{ authDecV20: ad, src: src, buffer: make(packageV20, maxPackageSize), }, nil }
go
func decryptReaderV20(src io.Reader, config *Config) (*decReaderV20, error) { ad, err := newAuthDecV20(config) if err != nil { return nil, err } return &decReaderV20{ authDecV20: ad, src: src, buffer: make(packageV20, maxPackageSize), }, nil }
[ "func", "decryptReaderV20", "(", "src", "io", ".", "Reader", ",", "config", "*", "Config", ")", "(", "*", "decReaderV20", ",", "error", ")", "{", "ad", ",", "err", ":=", "newAuthDecV20", "(", "config", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "&", "decReaderV20", "{", "authDecV20", ":", "ad", ",", "src", ":", "src", ",", "buffer", ":", "make", "(", "packageV20", ",", "maxPackageSize", ")", ",", "}", ",", "nil", "\n", "}" ]
// decryptReaderV20 returns an io.Reader wrapping the given io.Reader. // The returned io.Reader decrypts everything it reads using DARE 2.0.
[ "decryptReaderV20", "returns", "an", "io", ".", "Reader", "wrapping", "the", "given", "io", ".", "Reader", ".", "The", "returned", "io", ".", "Reader", "decrypts", "everything", "it", "reads", "using", "DARE", "2", ".", "0", "." ]
035b4ef8c449ba2ba21ec143c91964e76a1fb68c
https://github.com/minio/sio/blob/035b4ef8c449ba2ba21ec143c91964e76a1fb68c/reader-v2.go#L121-L131
145,128
minio/sio
writer-v1.go
decryptWriterV10
func decryptWriterV10(dst io.Writer, config *Config) (*decWriterV10, error) { ad, err := newAuthDecV10(config) if err != nil { return nil, err } return &decWriterV10{ authDecV10: ad, dst: dst, buffer: make(packageV10, maxPackageSize), }, nil }
go
func decryptWriterV10(dst io.Writer, config *Config) (*decWriterV10, error) { ad, err := newAuthDecV10(config) if err != nil { return nil, err } return &decWriterV10{ authDecV10: ad, dst: dst, buffer: make(packageV10, maxPackageSize), }, nil }
[ "func", "decryptWriterV10", "(", "dst", "io", ".", "Writer", ",", "config", "*", "Config", ")", "(", "*", "decWriterV10", ",", "error", ")", "{", "ad", ",", "err", ":=", "newAuthDecV10", "(", "config", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "&", "decWriterV10", "{", "authDecV10", ":", "ad", ",", "dst", ":", "dst", ",", "buffer", ":", "make", "(", "packageV10", ",", "maxPackageSize", ")", ",", "}", ",", "nil", "\n", "}" ]
// decryptWriterV10 returns an io.WriteCloser wrapping the given io.Writer. // The returned io.WriteCloser decrypts everything written to it using DARE 1.0 // and writes all decrypted plaintext to the wrapped io.Writer. // // The io.WriteCloser must be closed to finalize the decryption successfully.
[ "decryptWriterV10", "returns", "an", "io", ".", "WriteCloser", "wrapping", "the", "given", "io", ".", "Writer", ".", "The", "returned", "io", ".", "WriteCloser", "decrypts", "everything", "written", "to", "it", "using", "DARE", "1", ".", "0", "and", "writes", "all", "decrypted", "plaintext", "to", "the", "wrapped", "io", ".", "Writer", ".", "The", "io", ".", "WriteCloser", "must", "be", "closed", "to", "finalize", "the", "decryption", "successfully", "." ]
035b4ef8c449ba2ba21ec143c91964e76a1fb68c
https://github.com/minio/sio/blob/035b4ef8c449ba2ba21ec143c91964e76a1fb68c/writer-v1.go#L32-L42
145,129
minio/sio
writer-v1.go
encryptWriterV10
func encryptWriterV10(dst io.Writer, config *Config) (*encWriterV10, error) { ae, err := newAuthEncV10(config) if err != nil { return nil, err } return &encWriterV10{ authEncV10: ae, dst: dst, buffer: make(packageV10, maxPackageSize), payloadSize: config.PayloadSize, }, nil }
go
func encryptWriterV10(dst io.Writer, config *Config) (*encWriterV10, error) { ae, err := newAuthEncV10(config) if err != nil { return nil, err } return &encWriterV10{ authEncV10: ae, dst: dst, buffer: make(packageV10, maxPackageSize), payloadSize: config.PayloadSize, }, nil }
[ "func", "encryptWriterV10", "(", "dst", "io", ".", "Writer", ",", "config", "*", "Config", ")", "(", "*", "encWriterV10", ",", "error", ")", "{", "ae", ",", "err", ":=", "newAuthEncV10", "(", "config", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "&", "encWriterV10", "{", "authEncV10", ":", "ae", ",", "dst", ":", "dst", ",", "buffer", ":", "make", "(", "packageV10", ",", "maxPackageSize", ")", ",", "payloadSize", ":", "config", ".", "PayloadSize", ",", "}", ",", "nil", "\n", "}" ]
// encryptWriterV10 returns an io.WriteCloser wrapping the given io.Writer. // The returned io.WriteCloser encrypts everything written to it using DARE 1.0 // and writes all encrypted ciphertext as well as the package header and tag // to the wrapped io.Writer. // // The io.WriteCloser must be closed to finalize the encryption successfully.
[ "encryptWriterV10", "returns", "an", "io", ".", "WriteCloser", "wrapping", "the", "given", "io", ".", "Writer", ".", "The", "returned", "io", ".", "WriteCloser", "encrypts", "everything", "written", "to", "it", "using", "DARE", "1", ".", "0", "and", "writes", "all", "encrypted", "ciphertext", "as", "well", "as", "the", "package", "header", "and", "tag", "to", "the", "wrapped", "io", ".", "Writer", ".", "The", "io", ".", "WriteCloser", "must", "be", "closed", "to", "finalize", "the", "encryption", "successfully", "." ]
035b4ef8c449ba2ba21ec143c91964e76a1fb68c
https://github.com/minio/sio/blob/035b4ef8c449ba2ba21ec143c91964e76a1fb68c/writer-v1.go#L133-L144
145,130
xanzy/go-cloudstack
cloudstack/ProjectService.go
NewActivateProjectParams
func (s *ProjectService) NewActivateProjectParams(id string) *ActivateProjectParams { p := &ActivateProjectParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *ProjectService) NewActivateProjectParams(id string) *ActivateProjectParams { p := &ActivateProjectParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "ProjectService", ")", "NewActivateProjectParams", "(", "id", "string", ")", "*", "ActivateProjectParams", "{", "p", ":=", "&", "ActivateProjectParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ActivateProjectParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ActivateProjectParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ProjectService.go#L52-L57
145,131
xanzy/go-cloudstack
cloudstack/ProjectService.go
NewCreateProjectParams
func (s *ProjectService) NewCreateProjectParams(displaytext string, name string) *CreateProjectParams { p := &CreateProjectParams{} p.p = make(map[string]interface{}) p.p["displaytext"] = displaytext p.p["name"] = name return p }
go
func (s *ProjectService) NewCreateProjectParams(displaytext string, name string) *CreateProjectParams { p := &CreateProjectParams{} p.p = make(map[string]interface{}) p.p["displaytext"] = displaytext p.p["name"] = name return p }
[ "func", "(", "s", "*", "ProjectService", ")", "NewCreateProjectParams", "(", "displaytext", "string", ",", "name", "string", ")", "*", "CreateProjectParams", "{", "p", ":=", "&", "CreateProjectParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "displaytext", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "name", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new CreateProjectParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "CreateProjectParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ProjectService.go#L200-L206
145,132
xanzy/go-cloudstack
cloudstack/ProjectService.go
NewDeleteProjectParams
func (s *ProjectService) NewDeleteProjectParams(id string) *DeleteProjectParams { p := &DeleteProjectParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *ProjectService) NewDeleteProjectParams(id string) *DeleteProjectParams { p := &DeleteProjectParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "ProjectService", ")", "NewDeleteProjectParams", "(", "id", "string", ")", "*", "DeleteProjectParams", "{", "p", ":=", "&", "DeleteProjectParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new DeleteProjectParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "DeleteProjectParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ProjectService.go#L316-L321
145,133
xanzy/go-cloudstack
cloudstack/ProjectService.go
NewDeleteProjectInvitationParams
func (s *ProjectService) NewDeleteProjectInvitationParams(id string) *DeleteProjectInvitationParams { p := &DeleteProjectInvitationParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *ProjectService) NewDeleteProjectInvitationParams(id string) *DeleteProjectInvitationParams { p := &DeleteProjectInvitationParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "ProjectService", ")", "NewDeleteProjectInvitationParams", "(", "id", "string", ")", "*", "DeleteProjectInvitationParams", "{", "p", ":=", "&", "DeleteProjectInvitationParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new DeleteProjectInvitationParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "DeleteProjectInvitationParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ProjectService.go#L384-L389
145,134
xanzy/go-cloudstack
cloudstack/ProjectService.go
NewListProjectInvitationsParams
func (s *ProjectService) NewListProjectInvitationsParams() *ListProjectInvitationsParams { p := &ListProjectInvitationsParams{} p.p = make(map[string]interface{}) return p }
go
func (s *ProjectService) NewListProjectInvitationsParams() *ListProjectInvitationsParams { p := &ListProjectInvitationsParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "ProjectService", ")", "NewListProjectInvitationsParams", "(", ")", "*", "ListProjectInvitationsParams", "{", "p", ":=", "&", "ListProjectInvitationsParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListProjectInvitationsParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListProjectInvitationsParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ProjectService.go#L567-L571
145,135
xanzy/go-cloudstack
cloudstack/ProjectService.go
NewListProjectsParams
func (s *ProjectService) NewListProjectsParams() *ListProjectsParams { p := &ListProjectsParams{} p.p = make(map[string]interface{}) return p }
go
func (s *ProjectService) NewListProjectsParams() *ListProjectsParams { p := &ListProjectsParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "ProjectService", ")", "NewListProjectsParams", "(", ")", "*", "ListProjectsParams", "{", "p", ":=", "&", "ListProjectsParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListProjectsParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListProjectsParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ProjectService.go#L792-L796
145,136
xanzy/go-cloudstack
cloudstack/ProjectService.go
NewSuspendProjectParams
func (s *ProjectService) NewSuspendProjectParams(id string) *SuspendProjectParams { p := &SuspendProjectParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *ProjectService) NewSuspendProjectParams(id string) *SuspendProjectParams { p := &SuspendProjectParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "ProjectService", ")", "NewSuspendProjectParams", "(", "id", "string", ")", "*", "SuspendProjectParams", "{", "p", ":=", "&", "SuspendProjectParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new SuspendProjectParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "SuspendProjectParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ProjectService.go#L973-L978
145,137
xanzy/go-cloudstack
cloudstack/ProjectService.go
NewUpdateProjectParams
func (s *ProjectService) NewUpdateProjectParams(id string) *UpdateProjectParams { p := &UpdateProjectParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *ProjectService) NewUpdateProjectParams(id string) *UpdateProjectParams { p := &UpdateProjectParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "ProjectService", ")", "NewUpdateProjectParams", "(", "id", "string", ")", "*", "UpdateProjectParams", "{", "p", ":=", "&", "UpdateProjectParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new UpdateProjectParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "UpdateProjectParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ProjectService.go#L1110-L1115
145,138
xanzy/go-cloudstack
cloudstack/ProjectService.go
NewUpdateProjectInvitationParams
func (s *ProjectService) NewUpdateProjectInvitationParams(projectid string) *UpdateProjectInvitationParams { p := &UpdateProjectInvitationParams{} p.p = make(map[string]interface{}) p.p["projectid"] = projectid return p }
go
func (s *ProjectService) NewUpdateProjectInvitationParams(projectid string) *UpdateProjectInvitationParams { p := &UpdateProjectInvitationParams{} p.p = make(map[string]interface{}) p.p["projectid"] = projectid return p }
[ "func", "(", "s", "*", "ProjectService", ")", "NewUpdateProjectInvitationParams", "(", "projectid", "string", ")", "*", "UpdateProjectInvitationParams", "{", "p", ":=", "&", "UpdateProjectInvitationParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "projectid", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new UpdateProjectInvitationParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "UpdateProjectInvitationParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/ProjectService.go#L1259-L1264
145,139
xanzy/go-cloudstack
cloudstack/RoleService.go
NewCreateRoleParams
func (s *RoleService) NewCreateRoleParams(name string, roleType string) *CreateRoleParams { p := &CreateRoleParams{} p.p = make(map[string]interface{}) p.p["name"] = name p.p["type"] = roleType return p }
go
func (s *RoleService) NewCreateRoleParams(name string, roleType string) *CreateRoleParams { p := &CreateRoleParams{} p.p = make(map[string]interface{}) p.p["name"] = name p.p["type"] = roleType return p }
[ "func", "(", "s", "*", "RoleService", ")", "NewCreateRoleParams", "(", "name", "string", ",", "roleType", "string", ")", "*", "CreateRoleParams", "{", "p", ":=", "&", "CreateRoleParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "name", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "roleType", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new CreateRoleParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "CreateRoleParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RoleService.go#L73-L79
145,140
xanzy/go-cloudstack
cloudstack/RoleService.go
CreateRole
func (s *RoleService) CreateRole(p *CreateRoleParams) (*CreateRoleResponse, error) { resp, err := s.cs.newRequest("createRole", p.toURLValues()) if err != nil { return nil, err } var r CreateRoleResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *RoleService) CreateRole(p *CreateRoleParams) (*CreateRoleResponse, error) { resp, err := s.cs.newRequest("createRole", p.toURLValues()) if err != nil { return nil, err } var r CreateRoleResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "RoleService", ")", "CreateRole", "(", "p", "*", "CreateRoleParams", ")", "(", "*", "CreateRoleResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "CreateRoleResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Creates a role
[ "Creates", "a", "role" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RoleService.go#L82-L94
145,141
xanzy/go-cloudstack
cloudstack/RoleService.go
NewCreateRolePermissionParams
func (s *RoleService) NewCreateRolePermissionParams(permission string, roleid string, rule string) *CreateRolePermissionParams { p := &CreateRolePermissionParams{} p.p = make(map[string]interface{}) p.p["permission"] = permission p.p["roleid"] = roleid p.p["rule"] = rule return p }
go
func (s *RoleService) NewCreateRolePermissionParams(permission string, roleid string, rule string) *CreateRolePermissionParams { p := &CreateRolePermissionParams{} p.p = make(map[string]interface{}) p.p["permission"] = permission p.p["roleid"] = roleid p.p["rule"] = rule return p }
[ "func", "(", "s", "*", "RoleService", ")", "NewCreateRolePermissionParams", "(", "permission", "string", ",", "roleid", "string", ",", "rule", "string", ")", "*", "CreateRolePermissionParams", "{", "p", ":=", "&", "CreateRolePermissionParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "permission", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "roleid", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "rule", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new CreateRolePermissionParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "CreateRolePermissionParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RoleService.go#L161-L168
145,142
xanzy/go-cloudstack
cloudstack/RoleService.go
CreateRolePermission
func (s *RoleService) CreateRolePermission(p *CreateRolePermissionParams) (*CreateRolePermissionResponse, error) { resp, err := s.cs.newRequest("createRolePermission", p.toURLValues()) if err != nil { return nil, err } var r CreateRolePermissionResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *RoleService) CreateRolePermission(p *CreateRolePermissionParams) (*CreateRolePermissionResponse, error) { resp, err := s.cs.newRequest("createRolePermission", p.toURLValues()) if err != nil { return nil, err } var r CreateRolePermissionResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "RoleService", ")", "CreateRolePermission", "(", "p", "*", "CreateRolePermissionParams", ")", "(", "*", "CreateRolePermissionResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "CreateRolePermissionResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Adds a API permission to a role
[ "Adds", "a", "API", "permission", "to", "a", "role" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RoleService.go#L171-L183
145,143
xanzy/go-cloudstack
cloudstack/RoleService.go
NewDeleteRoleParams
func (s *RoleService) NewDeleteRoleParams(id string) *DeleteRoleParams { p := &DeleteRoleParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *RoleService) NewDeleteRoleParams(id string) *DeleteRoleParams { p := &DeleteRoleParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "RoleService", ")", "NewDeleteRoleParams", "(", "id", "string", ")", "*", "DeleteRoleParams", "{", "p", ":=", "&", "DeleteRoleParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new DeleteRoleParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "DeleteRoleParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RoleService.go#L219-L224
145,144
xanzy/go-cloudstack
cloudstack/RoleService.go
DeleteRole
func (s *RoleService) DeleteRole(p *DeleteRoleParams) (*DeleteRoleResponse, error) { resp, err := s.cs.newRequest("deleteRole", p.toURLValues()) if err != nil { return nil, err } var r DeleteRoleResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *RoleService) DeleteRole(p *DeleteRoleParams) (*DeleteRoleResponse, error) { resp, err := s.cs.newRequest("deleteRole", p.toURLValues()) if err != nil { return nil, err } var r DeleteRoleResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "RoleService", ")", "DeleteRole", "(", "p", "*", "DeleteRoleParams", ")", "(", "*", "DeleteRoleResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "DeleteRoleResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Deletes a role
[ "Deletes", "a", "role" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RoleService.go#L227-L239
145,145
xanzy/go-cloudstack
cloudstack/RoleService.go
NewDeleteRolePermissionParams
func (s *RoleService) NewDeleteRolePermissionParams(id string) *DeleteRolePermissionParams { p := &DeleteRolePermissionParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *RoleService) NewDeleteRolePermissionParams(id string) *DeleteRolePermissionParams { p := &DeleteRolePermissionParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "RoleService", ")", "NewDeleteRolePermissionParams", "(", "id", "string", ")", "*", "DeleteRolePermissionParams", "{", "p", ":=", "&", "DeleteRolePermissionParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new DeleteRolePermissionParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "DeleteRolePermissionParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RoleService.go#L290-L295
145,146
xanzy/go-cloudstack
cloudstack/RoleService.go
DeleteRolePermission
func (s *RoleService) DeleteRolePermission(p *DeleteRolePermissionParams) (*DeleteRolePermissionResponse, error) { resp, err := s.cs.newRequest("deleteRolePermission", p.toURLValues()) if err != nil { return nil, err } var r DeleteRolePermissionResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *RoleService) DeleteRolePermission(p *DeleteRolePermissionParams) (*DeleteRolePermissionResponse, error) { resp, err := s.cs.newRequest("deleteRolePermission", p.toURLValues()) if err != nil { return nil, err } var r DeleteRolePermissionResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "RoleService", ")", "DeleteRolePermission", "(", "p", "*", "DeleteRolePermissionParams", ")", "(", "*", "DeleteRolePermissionResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "DeleteRolePermissionResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Deletes a role permission
[ "Deletes", "a", "role", "permission" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RoleService.go#L298-L310
145,147
xanzy/go-cloudstack
cloudstack/RoleService.go
NewListRolePermissionsParams
func (s *RoleService) NewListRolePermissionsParams() *ListRolePermissionsParams { p := &ListRolePermissionsParams{} p.p = make(map[string]interface{}) return p }
go
func (s *RoleService) NewListRolePermissionsParams() *ListRolePermissionsParams { p := &ListRolePermissionsParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "RoleService", ")", "NewListRolePermissionsParams", "(", ")", "*", "ListRolePermissionsParams", "{", "p", ":=", "&", "ListRolePermissionsParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListRolePermissionsParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListRolePermissionsParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RoleService.go#L361-L365
145,148
xanzy/go-cloudstack
cloudstack/RoleService.go
ListRolePermissions
func (s *RoleService) ListRolePermissions(p *ListRolePermissionsParams) (*ListRolePermissionsResponse, error) { resp, err := s.cs.newRequest("listRolePermissions", p.toURLValues()) if err != nil { return nil, err } var r ListRolePermissionsResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *RoleService) ListRolePermissions(p *ListRolePermissionsParams) (*ListRolePermissionsResponse, error) { resp, err := s.cs.newRequest("listRolePermissions", p.toURLValues()) if err != nil { return nil, err } var r ListRolePermissionsResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "RoleService", ")", "ListRolePermissions", "(", "p", "*", "ListRolePermissionsParams", ")", "(", "*", "ListRolePermissionsResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "ListRolePermissionsResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Lists role permissions
[ "Lists", "role", "permissions" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RoleService.go#L368-L380
145,149
xanzy/go-cloudstack
cloudstack/RoleService.go
NewListRolesParams
func (s *RoleService) NewListRolesParams() *ListRolesParams { p := &ListRolesParams{} p.p = make(map[string]interface{}) return p }
go
func (s *RoleService) NewListRolesParams() *ListRolesParams { p := &ListRolesParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "RoleService", ")", "NewListRolesParams", "(", ")", "*", "ListRolesParams", "{", "p", ":=", "&", "ListRolesParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListRolesParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListRolesParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RoleService.go#L443-L447
145,150
xanzy/go-cloudstack
cloudstack/RoleService.go
ListRoles
func (s *RoleService) ListRoles(p *ListRolesParams) (*ListRolesResponse, error) { resp, err := s.cs.newRequest("listRoles", p.toURLValues()) if err != nil { return nil, err } var r ListRolesResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *RoleService) ListRoles(p *ListRolesParams) (*ListRolesResponse, error) { resp, err := s.cs.newRequest("listRoles", p.toURLValues()) if err != nil { return nil, err } var r ListRolesResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "RoleService", ")", "ListRoles", "(", "p", "*", "ListRolesParams", ")", "(", "*", "ListRolesResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "ListRolesResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Lists dynamic roles in CloudStack
[ "Lists", "dynamic", "roles", "in", "CloudStack" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RoleService.go#L533-L545
145,151
xanzy/go-cloudstack
cloudstack/RoleService.go
NewUpdateRoleParams
func (s *RoleService) NewUpdateRoleParams(id string) *UpdateRoleParams { p := &UpdateRoleParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *RoleService) NewUpdateRoleParams(id string) *UpdateRoleParams { p := &UpdateRoleParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "RoleService", ")", "NewUpdateRoleParams", "(", "id", "string", ")", "*", "UpdateRoleParams", "{", "p", ":=", "&", "UpdateRoleParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new UpdateRoleParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "UpdateRoleParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RoleService.go#L617-L622
145,152
xanzy/go-cloudstack
cloudstack/RoleService.go
UpdateRole
func (s *RoleService) UpdateRole(p *UpdateRoleParams) (*UpdateRoleResponse, error) { resp, err := s.cs.newRequest("updateRole", p.toURLValues()) if err != nil { return nil, err } var r UpdateRoleResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *RoleService) UpdateRole(p *UpdateRoleParams) (*UpdateRoleResponse, error) { resp, err := s.cs.newRequest("updateRole", p.toURLValues()) if err != nil { return nil, err } var r UpdateRoleResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "RoleService", ")", "UpdateRole", "(", "p", "*", "UpdateRoleParams", ")", "(", "*", "UpdateRoleResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "UpdateRoleResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Updates a role
[ "Updates", "a", "role" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RoleService.go#L625-L637
145,153
xanzy/go-cloudstack
cloudstack/RoleService.go
NewUpdateRolePermissionParams
func (s *RoleService) NewUpdateRolePermissionParams(roleid string) *UpdateRolePermissionParams { p := &UpdateRolePermissionParams{} p.p = make(map[string]interface{}) p.p["roleid"] = roleid return p }
go
func (s *RoleService) NewUpdateRolePermissionParams(roleid string) *UpdateRolePermissionParams { p := &UpdateRolePermissionParams{} p.p = make(map[string]interface{}) p.p["roleid"] = roleid return p }
[ "func", "(", "s", "*", "RoleService", ")", "NewUpdateRolePermissionParams", "(", "roleid", "string", ")", "*", "UpdateRolePermissionParams", "{", "p", ":=", "&", "UpdateRolePermissionParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "roleid", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new UpdateRolePermissionParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "UpdateRolePermissionParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RoleService.go#L705-L710
145,154
xanzy/go-cloudstack
cloudstack/RoleService.go
UpdateRolePermission
func (s *RoleService) UpdateRolePermission(p *UpdateRolePermissionParams) (*UpdateRolePermissionResponse, error) { resp, err := s.cs.newRequest("updateRolePermission", p.toURLValues()) if err != nil { return nil, err } var r UpdateRolePermissionResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *RoleService) UpdateRolePermission(p *UpdateRolePermissionParams) (*UpdateRolePermissionResponse, error) { resp, err := s.cs.newRequest("updateRolePermission", p.toURLValues()) if err != nil { return nil, err } var r UpdateRolePermissionResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "RoleService", ")", "UpdateRolePermission", "(", "p", "*", "UpdateRolePermissionParams", ")", "(", "*", "UpdateRolePermissionResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "UpdateRolePermissionResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Updates a role permission order
[ "Updates", "a", "role", "permission", "order" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/RoleService.go#L713-L725
145,155
xanzy/go-cloudstack
cloudstack/BrocadeVCSService.go
NewAddBrocadeVcsDeviceParams
func (s *BrocadeVCSService) NewAddBrocadeVcsDeviceParams(hostname string, password string, physicalnetworkid string, username string) *AddBrocadeVcsDeviceParams { p := &AddBrocadeVcsDeviceParams{} p.p = make(map[string]interface{}) p.p["hostname"] = hostname p.p["password"] = password p.p["physicalnetworkid"] = physicalnetworkid p.p["username"] = username return p }
go
func (s *BrocadeVCSService) NewAddBrocadeVcsDeviceParams(hostname string, password string, physicalnetworkid string, username string) *AddBrocadeVcsDeviceParams { p := &AddBrocadeVcsDeviceParams{} p.p = make(map[string]interface{}) p.p["hostname"] = hostname p.p["password"] = password p.p["physicalnetworkid"] = physicalnetworkid p.p["username"] = username return p }
[ "func", "(", "s", "*", "BrocadeVCSService", ")", "NewAddBrocadeVcsDeviceParams", "(", "hostname", "string", ",", "password", "string", ",", "physicalnetworkid", "string", ",", "username", "string", ")", "*", "AddBrocadeVcsDeviceParams", "{", "p", ":=", "&", "AddBrocadeVcsDeviceParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "hostname", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "password", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "physicalnetworkid", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "username", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new AddBrocadeVcsDeviceParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "AddBrocadeVcsDeviceParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/BrocadeVCSService.go#L84-L92
145,156
xanzy/go-cloudstack
cloudstack/BrocadeVCSService.go
AddBrocadeVcsDevice
func (s *BrocadeVCSService) AddBrocadeVcsDevice(p *AddBrocadeVcsDeviceParams) (*AddBrocadeVcsDeviceResponse, error) { resp, err := s.cs.newRequest("addBrocadeVcsDevice", p.toURLValues()) if err != nil { return nil, err } var r AddBrocadeVcsDeviceResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } b, err = getRawValue(b) if err != nil { return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
go
func (s *BrocadeVCSService) AddBrocadeVcsDevice(p *AddBrocadeVcsDeviceParams) (*AddBrocadeVcsDeviceResponse, error) { resp, err := s.cs.newRequest("addBrocadeVcsDevice", p.toURLValues()) if err != nil { return nil, err } var r AddBrocadeVcsDeviceResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } b, err = getRawValue(b) if err != nil { return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
[ "func", "(", "s", "*", "BrocadeVCSService", ")", "AddBrocadeVcsDevice", "(", "p", "*", "AddBrocadeVcsDeviceParams", ")", "(", "*", "AddBrocadeVcsDeviceResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "AddBrocadeVcsDeviceResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "// If we have a async client, we need to wait for the async result", "if", "s", ".", "cs", ".", "async", "{", "b", ",", "err", ":=", "s", ".", "cs", ".", "GetAsyncJobResult", "(", "r", ".", "JobID", ",", "s", ".", "cs", ".", "timeout", ")", "\n", "if", "err", "!=", "nil", "{", "if", "err", "==", "AsyncTimeoutErr", "{", "return", "&", "r", ",", "err", "\n", "}", "\n", "return", "nil", ",", "err", "\n", "}", "\n\n", "b", ",", "err", "=", "getRawValue", "(", "b", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "b", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Adds a Brocade VCS Switch
[ "Adds", "a", "Brocade", "VCS", "Switch" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/BrocadeVCSService.go#L95-L127
145,157
xanzy/go-cloudstack
cloudstack/BrocadeVCSService.go
NewDeleteBrocadeVcsDeviceParams
func (s *BrocadeVCSService) NewDeleteBrocadeVcsDeviceParams(vcsdeviceid string) *DeleteBrocadeVcsDeviceParams { p := &DeleteBrocadeVcsDeviceParams{} p.p = make(map[string]interface{}) p.p["vcsdeviceid"] = vcsdeviceid return p }
go
func (s *BrocadeVCSService) NewDeleteBrocadeVcsDeviceParams(vcsdeviceid string) *DeleteBrocadeVcsDeviceParams { p := &DeleteBrocadeVcsDeviceParams{} p.p = make(map[string]interface{}) p.p["vcsdeviceid"] = vcsdeviceid return p }
[ "func", "(", "s", "*", "BrocadeVCSService", ")", "NewDeleteBrocadeVcsDeviceParams", "(", "vcsdeviceid", "string", ")", "*", "DeleteBrocadeVcsDeviceParams", "{", "p", ":=", "&", "DeleteBrocadeVcsDeviceParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "vcsdeviceid", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new DeleteBrocadeVcsDeviceParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "DeleteBrocadeVcsDeviceParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/BrocadeVCSService.go#L163-L168
145,158
xanzy/go-cloudstack
cloudstack/BrocadeVCSService.go
DeleteBrocadeVcsDevice
func (s *BrocadeVCSService) DeleteBrocadeVcsDevice(p *DeleteBrocadeVcsDeviceParams) (*DeleteBrocadeVcsDeviceResponse, error) { resp, err := s.cs.newRequest("deleteBrocadeVcsDevice", p.toURLValues()) if err != nil { return nil, err } var r DeleteBrocadeVcsDeviceResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
go
func (s *BrocadeVCSService) DeleteBrocadeVcsDevice(p *DeleteBrocadeVcsDeviceParams) (*DeleteBrocadeVcsDeviceResponse, error) { resp, err := s.cs.newRequest("deleteBrocadeVcsDevice", p.toURLValues()) if err != nil { return nil, err } var r DeleteBrocadeVcsDeviceResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
[ "func", "(", "s", "*", "BrocadeVCSService", ")", "DeleteBrocadeVcsDevice", "(", "p", "*", "DeleteBrocadeVcsDeviceParams", ")", "(", "*", "DeleteBrocadeVcsDeviceResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "DeleteBrocadeVcsDeviceResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "// If we have a async client, we need to wait for the async result", "if", "s", ".", "cs", ".", "async", "{", "b", ",", "err", ":=", "s", ".", "cs", ".", "GetAsyncJobResult", "(", "r", ".", "JobID", ",", "s", ".", "cs", ".", "timeout", ")", "\n", "if", "err", "!=", "nil", "{", "if", "err", "==", "AsyncTimeoutErr", "{", "return", "&", "r", ",", "err", "\n", "}", "\n", "return", "nil", ",", "err", "\n", "}", "\n\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "b", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// delete a Brocade VCS Switch
[ "delete", "a", "Brocade", "VCS", "Switch" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/BrocadeVCSService.go#L171-L198
145,159
xanzy/go-cloudstack
cloudstack/BrocadeVCSService.go
NewListBrocadeVcsDeviceNetworksParams
func (s *BrocadeVCSService) NewListBrocadeVcsDeviceNetworksParams(vcsdeviceid string) *ListBrocadeVcsDeviceNetworksParams { p := &ListBrocadeVcsDeviceNetworksParams{} p.p = make(map[string]interface{}) p.p["vcsdeviceid"] = vcsdeviceid return p }
go
func (s *BrocadeVCSService) NewListBrocadeVcsDeviceNetworksParams(vcsdeviceid string) *ListBrocadeVcsDeviceNetworksParams { p := &ListBrocadeVcsDeviceNetworksParams{} p.p = make(map[string]interface{}) p.p["vcsdeviceid"] = vcsdeviceid return p }
[ "func", "(", "s", "*", "BrocadeVCSService", ")", "NewListBrocadeVcsDeviceNetworksParams", "(", "vcsdeviceid", "string", ")", "*", "ListBrocadeVcsDeviceNetworksParams", "{", "p", ":=", "&", "ListBrocadeVcsDeviceNetworksParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "vcsdeviceid", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListBrocadeVcsDeviceNetworksParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListBrocadeVcsDeviceNetworksParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/BrocadeVCSService.go#L266-L271
145,160
xanzy/go-cloudstack
cloudstack/BrocadeVCSService.go
ListBrocadeVcsDeviceNetworks
func (s *BrocadeVCSService) ListBrocadeVcsDeviceNetworks(p *ListBrocadeVcsDeviceNetworksParams) (*ListBrocadeVcsDeviceNetworksResponse, error) { resp, err := s.cs.newRequest("listBrocadeVcsDeviceNetworks", p.toURLValues()) if err != nil { return nil, err } var r ListBrocadeVcsDeviceNetworksResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *BrocadeVCSService) ListBrocadeVcsDeviceNetworks(p *ListBrocadeVcsDeviceNetworksParams) (*ListBrocadeVcsDeviceNetworksResponse, error) { resp, err := s.cs.newRequest("listBrocadeVcsDeviceNetworks", p.toURLValues()) if err != nil { return nil, err } var r ListBrocadeVcsDeviceNetworksResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "BrocadeVCSService", ")", "ListBrocadeVcsDeviceNetworks", "(", "p", "*", "ListBrocadeVcsDeviceNetworksParams", ")", "(", "*", "ListBrocadeVcsDeviceNetworksResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "ListBrocadeVcsDeviceNetworksResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// lists network that are using a brocade vcs switch
[ "lists", "network", "that", "are", "using", "a", "brocade", "vcs", "switch" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/BrocadeVCSService.go#L311-L323
145,161
xanzy/go-cloudstack
cloudstack/BrocadeVCSService.go
NewListBrocadeVcsDevicesParams
func (s *BrocadeVCSService) NewListBrocadeVcsDevicesParams() *ListBrocadeVcsDevicesParams { p := &ListBrocadeVcsDevicesParams{} p.p = make(map[string]interface{}) return p }
go
func (s *BrocadeVCSService) NewListBrocadeVcsDevicesParams() *ListBrocadeVcsDevicesParams { p := &ListBrocadeVcsDevicesParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "BrocadeVCSService", ")", "NewListBrocadeVcsDevicesParams", "(", ")", "*", "ListBrocadeVcsDevicesParams", "{", "p", ":=", "&", "ListBrocadeVcsDevicesParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListBrocadeVcsDevicesParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListBrocadeVcsDevicesParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/BrocadeVCSService.go#L476-L480
145,162
xanzy/go-cloudstack
cloudstack/BrocadeVCSService.go
ListBrocadeVcsDevices
func (s *BrocadeVCSService) ListBrocadeVcsDevices(p *ListBrocadeVcsDevicesParams) (*ListBrocadeVcsDevicesResponse, error) { resp, err := s.cs.newRequest("listBrocadeVcsDevices", p.toURLValues()) if err != nil { return nil, err } var r ListBrocadeVcsDevicesResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *BrocadeVCSService) ListBrocadeVcsDevices(p *ListBrocadeVcsDevicesParams) (*ListBrocadeVcsDevicesResponse, error) { resp, err := s.cs.newRequest("listBrocadeVcsDevices", p.toURLValues()) if err != nil { return nil, err } var r ListBrocadeVcsDevicesResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "BrocadeVCSService", ")", "ListBrocadeVcsDevices", "(", "p", "*", "ListBrocadeVcsDevicesParams", ")", "(", "*", "ListBrocadeVcsDevicesResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "ListBrocadeVcsDevicesResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Lists Brocade VCS Switches
[ "Lists", "Brocade", "VCS", "Switches" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/BrocadeVCSService.go#L483-L495
145,163
xanzy/go-cloudstack
cloudstack/VLANService.go
NewCreateVlanIpRangeParams
func (s *VLANService) NewCreateVlanIpRangeParams() *CreateVlanIpRangeParams { p := &CreateVlanIpRangeParams{} p.p = make(map[string]interface{}) return p }
go
func (s *VLANService) NewCreateVlanIpRangeParams() *CreateVlanIpRangeParams { p := &CreateVlanIpRangeParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "VLANService", ")", "NewCreateVlanIpRangeParams", "(", ")", "*", "CreateVlanIpRangeParams", "{", "p", ":=", "&", "CreateVlanIpRangeParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new CreateVlanIpRangeParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "CreateVlanIpRangeParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/VLANService.go#L241-L245
145,164
xanzy/go-cloudstack
cloudstack/VLANService.go
NewDedicateGuestVlanRangeParams
func (s *VLANService) NewDedicateGuestVlanRangeParams(physicalnetworkid string, vlanrange string) *DedicateGuestVlanRangeParams { p := &DedicateGuestVlanRangeParams{} p.p = make(map[string]interface{}) p.p["physicalnetworkid"] = physicalnetworkid p.p["vlanrange"] = vlanrange return p }
go
func (s *VLANService) NewDedicateGuestVlanRangeParams(physicalnetworkid string, vlanrange string) *DedicateGuestVlanRangeParams { p := &DedicateGuestVlanRangeParams{} p.p = make(map[string]interface{}) p.p["physicalnetworkid"] = physicalnetworkid p.p["vlanrange"] = vlanrange return p }
[ "func", "(", "s", "*", "VLANService", ")", "NewDedicateGuestVlanRangeParams", "(", "physicalnetworkid", "string", ",", "vlanrange", "string", ")", "*", "DedicateGuestVlanRangeParams", "{", "p", ":=", "&", "DedicateGuestVlanRangeParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "physicalnetworkid", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "vlanrange", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new DedicateGuestVlanRangeParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "DedicateGuestVlanRangeParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/VLANService.go#L357-L363
145,165
xanzy/go-cloudstack
cloudstack/VLANService.go
DedicateGuestVlanRange
func (s *VLANService) DedicateGuestVlanRange(p *DedicateGuestVlanRangeParams) (*DedicateGuestVlanRangeResponse, error) { resp, err := s.cs.newRequest("dedicateGuestVlanRange", p.toURLValues()) if err != nil { return nil, err } var r DedicateGuestVlanRangeResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *VLANService) DedicateGuestVlanRange(p *DedicateGuestVlanRangeParams) (*DedicateGuestVlanRangeResponse, error) { resp, err := s.cs.newRequest("dedicateGuestVlanRange", p.toURLValues()) if err != nil { return nil, err } var r DedicateGuestVlanRangeResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "VLANService", ")", "DedicateGuestVlanRange", "(", "p", "*", "DedicateGuestVlanRangeParams", ")", "(", "*", "DedicateGuestVlanRangeResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "DedicateGuestVlanRangeResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Dedicates a guest vlan range to an account
[ "Dedicates", "a", "guest", "vlan", "range", "to", "an", "account" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/VLANService.go#L366-L378
145,166
xanzy/go-cloudstack
cloudstack/VLANService.go
NewDeleteVlanIpRangeParams
func (s *VLANService) NewDeleteVlanIpRangeParams(id string) *DeleteVlanIpRangeParams { p := &DeleteVlanIpRangeParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *VLANService) NewDeleteVlanIpRangeParams(id string) *DeleteVlanIpRangeParams { p := &DeleteVlanIpRangeParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "VLANService", ")", "NewDeleteVlanIpRangeParams", "(", "id", "string", ")", "*", "DeleteVlanIpRangeParams", "{", "p", ":=", "&", "DeleteVlanIpRangeParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new DeleteVlanIpRangeParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "DeleteVlanIpRangeParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/VLANService.go#L417-L422
145,167
xanzy/go-cloudstack
cloudstack/VLANService.go
NewListDedicatedGuestVlanRangesParams
func (s *VLANService) NewListDedicatedGuestVlanRangesParams() *ListDedicatedGuestVlanRangesParams { p := &ListDedicatedGuestVlanRangesParams{} p.p = make(map[string]interface{}) return p }
go
func (s *VLANService) NewListDedicatedGuestVlanRangesParams() *ListDedicatedGuestVlanRangesParams { p := &ListDedicatedGuestVlanRangesParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "VLANService", ")", "NewListDedicatedGuestVlanRangesParams", "(", ")", "*", "ListDedicatedGuestVlanRangesParams", "{", "p", ":=", "&", "ListDedicatedGuestVlanRangesParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListDedicatedGuestVlanRangesParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListDedicatedGuestVlanRangesParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/VLANService.go#L589-L593
145,168
xanzy/go-cloudstack
cloudstack/VLANService.go
ListDedicatedGuestVlanRanges
func (s *VLANService) ListDedicatedGuestVlanRanges(p *ListDedicatedGuestVlanRangesParams) (*ListDedicatedGuestVlanRangesResponse, error) { resp, err := s.cs.newRequest("listDedicatedGuestVlanRanges", p.toURLValues()) if err != nil { return nil, err } var r ListDedicatedGuestVlanRangesResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *VLANService) ListDedicatedGuestVlanRanges(p *ListDedicatedGuestVlanRangesParams) (*ListDedicatedGuestVlanRangesResponse, error) { resp, err := s.cs.newRequest("listDedicatedGuestVlanRanges", p.toURLValues()) if err != nil { return nil, err } var r ListDedicatedGuestVlanRangesResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "VLANService", ")", "ListDedicatedGuestVlanRanges", "(", "p", "*", "ListDedicatedGuestVlanRangesParams", ")", "(", "*", "ListDedicatedGuestVlanRangesResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "ListDedicatedGuestVlanRangesResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Lists dedicated guest vlan ranges
[ "Lists", "dedicated", "guest", "vlan", "ranges" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/VLANService.go#L629-L641
145,169
xanzy/go-cloudstack
cloudstack/VLANService.go
NewListVlanIpRangesParams
func (s *VLANService) NewListVlanIpRangesParams() *ListVlanIpRangesParams { p := &ListVlanIpRangesParams{} p.p = make(map[string]interface{}) return p }
go
func (s *VLANService) NewListVlanIpRangesParams() *ListVlanIpRangesParams { p := &ListVlanIpRangesParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "VLANService", ")", "NewListVlanIpRangesParams", "(", ")", "*", "ListVlanIpRangesParams", "{", "p", ":=", "&", "ListVlanIpRangesParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListVlanIpRangesParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListVlanIpRangesParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/VLANService.go#L820-L824
145,170
xanzy/go-cloudstack
cloudstack/VLANService.go
ListVlanIpRanges
func (s *VLANService) ListVlanIpRanges(p *ListVlanIpRangesParams) (*ListVlanIpRangesResponse, error) { resp, err := s.cs.newRequest("listVlanIpRanges", p.toURLValues()) if err != nil { return nil, err } var r ListVlanIpRangesResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *VLANService) ListVlanIpRanges(p *ListVlanIpRangesParams) (*ListVlanIpRangesResponse, error) { resp, err := s.cs.newRequest("listVlanIpRanges", p.toURLValues()) if err != nil { return nil, err } var r ListVlanIpRangesResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "VLANService", ")", "ListVlanIpRanges", "(", "p", "*", "ListVlanIpRangesParams", ")", "(", "*", "ListVlanIpRangesResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "ListVlanIpRangesResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Lists all VLAN IP ranges.
[ "Lists", "all", "VLAN", "IP", "ranges", "." ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/VLANService.go#L860-L872
145,171
xanzy/go-cloudstack
cloudstack/VLANService.go
NewReleaseDedicatedGuestVlanRangeParams
func (s *VLANService) NewReleaseDedicatedGuestVlanRangeParams(id string) *ReleaseDedicatedGuestVlanRangeParams { p := &ReleaseDedicatedGuestVlanRangeParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *VLANService) NewReleaseDedicatedGuestVlanRangeParams(id string) *ReleaseDedicatedGuestVlanRangeParams { p := &ReleaseDedicatedGuestVlanRangeParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "VLANService", ")", "NewReleaseDedicatedGuestVlanRangeParams", "(", "id", "string", ")", "*", "ReleaseDedicatedGuestVlanRangeParams", "{", "p", ":=", "&", "ReleaseDedicatedGuestVlanRangeParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ReleaseDedicatedGuestVlanRangeParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ReleaseDedicatedGuestVlanRangeParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/VLANService.go#L930-L935
145,172
xanzy/go-cloudstack
cloudstack/VLANService.go
ReleaseDedicatedGuestVlanRange
func (s *VLANService) ReleaseDedicatedGuestVlanRange(p *ReleaseDedicatedGuestVlanRangeParams) (*ReleaseDedicatedGuestVlanRangeResponse, error) { resp, err := s.cs.newRequest("releaseDedicatedGuestVlanRange", p.toURLValues()) if err != nil { return nil, err } var r ReleaseDedicatedGuestVlanRangeResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
go
func (s *VLANService) ReleaseDedicatedGuestVlanRange(p *ReleaseDedicatedGuestVlanRangeParams) (*ReleaseDedicatedGuestVlanRangeResponse, error) { resp, err := s.cs.newRequest("releaseDedicatedGuestVlanRange", p.toURLValues()) if err != nil { return nil, err } var r ReleaseDedicatedGuestVlanRangeResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
[ "func", "(", "s", "*", "VLANService", ")", "ReleaseDedicatedGuestVlanRange", "(", "p", "*", "ReleaseDedicatedGuestVlanRangeParams", ")", "(", "*", "ReleaseDedicatedGuestVlanRangeResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "ReleaseDedicatedGuestVlanRangeResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "// If we have a async client, we need to wait for the async result", "if", "s", ".", "cs", ".", "async", "{", "b", ",", "err", ":=", "s", ".", "cs", ".", "GetAsyncJobResult", "(", "r", ".", "JobID", ",", "s", ".", "cs", ".", "timeout", ")", "\n", "if", "err", "!=", "nil", "{", "if", "err", "==", "AsyncTimeoutErr", "{", "return", "&", "r", ",", "err", "\n", "}", "\n", "return", "nil", ",", "err", "\n", "}", "\n\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "b", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Releases a dedicated guest vlan range to the system
[ "Releases", "a", "dedicated", "guest", "vlan", "range", "to", "the", "system" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/VLANService.go#L938-L965
145,173
xanzy/go-cloudstack
cloudstack/NATService.go
NewCreateIpForwardingRuleParams
func (s *NATService) NewCreateIpForwardingRuleParams(ipaddressid string, protocol string, startport int) *CreateIpForwardingRuleParams { p := &CreateIpForwardingRuleParams{} p.p = make(map[string]interface{}) p.p["ipaddressid"] = ipaddressid p.p["protocol"] = protocol p.p["startport"] = startport return p }
go
func (s *NATService) NewCreateIpForwardingRuleParams(ipaddressid string, protocol string, startport int) *CreateIpForwardingRuleParams { p := &CreateIpForwardingRuleParams{} p.p = make(map[string]interface{}) p.p["ipaddressid"] = ipaddressid p.p["protocol"] = protocol p.p["startport"] = startport return p }
[ "func", "(", "s", "*", "NATService", ")", "NewCreateIpForwardingRuleParams", "(", "ipaddressid", "string", ",", "protocol", "string", ",", "startport", "int", ")", "*", "CreateIpForwardingRuleParams", "{", "p", ":=", "&", "CreateIpForwardingRuleParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "ipaddressid", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "protocol", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "startport", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new CreateIpForwardingRuleParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "CreateIpForwardingRuleParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NATService.go#L111-L118
145,174
xanzy/go-cloudstack
cloudstack/NATService.go
CreateIpForwardingRule
func (s *NATService) CreateIpForwardingRule(p *CreateIpForwardingRuleParams) (*CreateIpForwardingRuleResponse, error) { resp, err := s.cs.newRequest("createIpForwardingRule", p.toURLValues()) if err != nil { return nil, err } var r CreateIpForwardingRuleResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } b, err = getRawValue(b) if err != nil { return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
go
func (s *NATService) CreateIpForwardingRule(p *CreateIpForwardingRuleParams) (*CreateIpForwardingRuleResponse, error) { resp, err := s.cs.newRequest("createIpForwardingRule", p.toURLValues()) if err != nil { return nil, err } var r CreateIpForwardingRuleResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } b, err = getRawValue(b) if err != nil { return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
[ "func", "(", "s", "*", "NATService", ")", "CreateIpForwardingRule", "(", "p", "*", "CreateIpForwardingRuleParams", ")", "(", "*", "CreateIpForwardingRuleResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "CreateIpForwardingRuleResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "// If we have a async client, we need to wait for the async result", "if", "s", ".", "cs", ".", "async", "{", "b", ",", "err", ":=", "s", ".", "cs", ".", "GetAsyncJobResult", "(", "r", ".", "JobID", ",", "s", ".", "cs", ".", "timeout", ")", "\n", "if", "err", "!=", "nil", "{", "if", "err", "==", "AsyncTimeoutErr", "{", "return", "&", "r", ",", "err", "\n", "}", "\n", "return", "nil", ",", "err", "\n", "}", "\n\n", "b", ",", "err", "=", "getRawValue", "(", "b", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "b", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Creates an IP forwarding rule
[ "Creates", "an", "IP", "forwarding", "rule" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NATService.go#L121-L153
145,175
xanzy/go-cloudstack
cloudstack/NATService.go
NewDeleteIpForwardingRuleParams
func (s *NATService) NewDeleteIpForwardingRuleParams(id string) *DeleteIpForwardingRuleParams { p := &DeleteIpForwardingRuleParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *NATService) NewDeleteIpForwardingRuleParams(id string) *DeleteIpForwardingRuleParams { p := &DeleteIpForwardingRuleParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "NATService", ")", "NewDeleteIpForwardingRuleParams", "(", "id", "string", ")", "*", "DeleteIpForwardingRuleParams", "{", "p", ":=", "&", "DeleteIpForwardingRuleParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new DeleteIpForwardingRuleParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "DeleteIpForwardingRuleParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NATService.go#L201-L206
145,176
xanzy/go-cloudstack
cloudstack/NATService.go
DeleteIpForwardingRule
func (s *NATService) DeleteIpForwardingRule(p *DeleteIpForwardingRuleParams) (*DeleteIpForwardingRuleResponse, error) { resp, err := s.cs.newRequest("deleteIpForwardingRule", p.toURLValues()) if err != nil { return nil, err } var r DeleteIpForwardingRuleResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
go
func (s *NATService) DeleteIpForwardingRule(p *DeleteIpForwardingRuleParams) (*DeleteIpForwardingRuleResponse, error) { resp, err := s.cs.newRequest("deleteIpForwardingRule", p.toURLValues()) if err != nil { return nil, err } var r DeleteIpForwardingRuleResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
[ "func", "(", "s", "*", "NATService", ")", "DeleteIpForwardingRule", "(", "p", "*", "DeleteIpForwardingRuleParams", ")", "(", "*", "DeleteIpForwardingRuleResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "DeleteIpForwardingRuleResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "// If we have a async client, we need to wait for the async result", "if", "s", ".", "cs", ".", "async", "{", "b", ",", "err", ":=", "s", ".", "cs", ".", "GetAsyncJobResult", "(", "r", ".", "JobID", ",", "s", ".", "cs", ".", "timeout", ")", "\n", "if", "err", "!=", "nil", "{", "if", "err", "==", "AsyncTimeoutErr", "{", "return", "&", "r", ",", "err", "\n", "}", "\n", "return", "nil", ",", "err", "\n", "}", "\n\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "b", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Deletes an IP forwarding rule
[ "Deletes", "an", "IP", "forwarding", "rule" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NATService.go#L209-L236
145,177
xanzy/go-cloudstack
cloudstack/NATService.go
NewDisableStaticNatParams
func (s *NATService) NewDisableStaticNatParams(ipaddressid string) *DisableStaticNatParams { p := &DisableStaticNatParams{} p.p = make(map[string]interface{}) p.p["ipaddressid"] = ipaddressid return p }
go
func (s *NATService) NewDisableStaticNatParams(ipaddressid string) *DisableStaticNatParams { p := &DisableStaticNatParams{} p.p = make(map[string]interface{}) p.p["ipaddressid"] = ipaddressid return p }
[ "func", "(", "s", "*", "NATService", ")", "NewDisableStaticNatParams", "(", "ipaddressid", "string", ")", "*", "DisableStaticNatParams", "{", "p", ":=", "&", "DisableStaticNatParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "ipaddressid", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new DisableStaticNatParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "DisableStaticNatParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NATService.go#L269-L274
145,178
xanzy/go-cloudstack
cloudstack/NATService.go
DisableStaticNat
func (s *NATService) DisableStaticNat(p *DisableStaticNatParams) (*DisableStaticNatResponse, error) { resp, err := s.cs.newRequest("disableStaticNat", p.toURLValues()) if err != nil { return nil, err } var r DisableStaticNatResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
go
func (s *NATService) DisableStaticNat(p *DisableStaticNatParams) (*DisableStaticNatResponse, error) { resp, err := s.cs.newRequest("disableStaticNat", p.toURLValues()) if err != nil { return nil, err } var r DisableStaticNatResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
[ "func", "(", "s", "*", "NATService", ")", "DisableStaticNat", "(", "p", "*", "DisableStaticNatParams", ")", "(", "*", "DisableStaticNatResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "DisableStaticNatResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "// If we have a async client, we need to wait for the async result", "if", "s", ".", "cs", ".", "async", "{", "b", ",", "err", ":=", "s", ".", "cs", ".", "GetAsyncJobResult", "(", "r", ".", "JobID", ",", "s", ".", "cs", ".", "timeout", ")", "\n", "if", "err", "!=", "nil", "{", "if", "err", "==", "AsyncTimeoutErr", "{", "return", "&", "r", ",", "err", "\n", "}", "\n", "return", "nil", ",", "err", "\n", "}", "\n\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "b", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Disables static rule for given IP address
[ "Disables", "static", "rule", "for", "given", "IP", "address" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NATService.go#L277-L304
145,179
xanzy/go-cloudstack
cloudstack/NATService.go
NewEnableStaticNatParams
func (s *NATService) NewEnableStaticNatParams(ipaddressid string, virtualmachineid string) *EnableStaticNatParams { p := &EnableStaticNatParams{} p.p = make(map[string]interface{}) p.p["ipaddressid"] = ipaddressid p.p["virtualmachineid"] = virtualmachineid return p }
go
func (s *NATService) NewEnableStaticNatParams(ipaddressid string, virtualmachineid string) *EnableStaticNatParams { p := &EnableStaticNatParams{} p.p = make(map[string]interface{}) p.p["ipaddressid"] = ipaddressid p.p["virtualmachineid"] = virtualmachineid return p }
[ "func", "(", "s", "*", "NATService", ")", "NewEnableStaticNatParams", "(", "ipaddressid", "string", ",", "virtualmachineid", "string", ")", "*", "EnableStaticNatParams", "{", "p", ":=", "&", "EnableStaticNatParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "ipaddressid", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "virtualmachineid", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new EnableStaticNatParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "EnableStaticNatParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NATService.go#L370-L376
145,180
xanzy/go-cloudstack
cloudstack/NATService.go
EnableStaticNat
func (s *NATService) EnableStaticNat(p *EnableStaticNatParams) (*EnableStaticNatResponse, error) { resp, err := s.cs.newRequest("enableStaticNat", p.toURLValues()) if err != nil { return nil, err } var r EnableStaticNatResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *NATService) EnableStaticNat(p *EnableStaticNatParams) (*EnableStaticNatResponse, error) { resp, err := s.cs.newRequest("enableStaticNat", p.toURLValues()) if err != nil { return nil, err } var r EnableStaticNatResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "NATService", ")", "EnableStaticNat", "(", "p", "*", "EnableStaticNatParams", ")", "(", "*", "EnableStaticNatResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "EnableStaticNatResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Enables static NAT for given IP address
[ "Enables", "static", "NAT", "for", "given", "IP", "address" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NATService.go#L379-L391
145,181
xanzy/go-cloudstack
cloudstack/NATService.go
NewListIpForwardingRulesParams
func (s *NATService) NewListIpForwardingRulesParams() *ListIpForwardingRulesParams { p := &ListIpForwardingRulesParams{} p.p = make(map[string]interface{}) return p }
go
func (s *NATService) NewListIpForwardingRulesParams() *ListIpForwardingRulesParams { p := &ListIpForwardingRulesParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "NATService", ")", "NewListIpForwardingRulesParams", "(", ")", "*", "ListIpForwardingRulesParams", "{", "p", ":=", "&", "ListIpForwardingRulesParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListIpForwardingRulesParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListIpForwardingRulesParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NATService.go#L556-L560
145,182
xanzy/go-cloudstack
cloudstack/NATService.go
ListIpForwardingRules
func (s *NATService) ListIpForwardingRules(p *ListIpForwardingRulesParams) (*ListIpForwardingRulesResponse, error) { resp, err := s.cs.newRequest("listIpForwardingRules", p.toURLValues()) if err != nil { return nil, err } var r ListIpForwardingRulesResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *NATService) ListIpForwardingRules(p *ListIpForwardingRulesParams) (*ListIpForwardingRulesResponse, error) { resp, err := s.cs.newRequest("listIpForwardingRules", p.toURLValues()) if err != nil { return nil, err } var r ListIpForwardingRulesResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "NATService", ")", "ListIpForwardingRules", "(", "p", "*", "ListIpForwardingRulesParams", ")", "(", "*", "ListIpForwardingRulesResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "ListIpForwardingRulesResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// List the IP forwarding rules
[ "List", "the", "IP", "forwarding", "rules" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NATService.go#L596-L608
145,183
xanzy/go-cloudstack
cloudstack/NuageVSPService.go
NewAddNuageVspDeviceParams
func (s *NuageVSPService) NewAddNuageVspDeviceParams(hostname string, password string, physicalnetworkid string, port int, username string) *AddNuageVspDeviceParams { p := &AddNuageVspDeviceParams{} p.p = make(map[string]interface{}) p.p["hostname"] = hostname p.p["password"] = password p.p["physicalnetworkid"] = physicalnetworkid p.p["port"] = port p.p["username"] = username return p }
go
func (s *NuageVSPService) NewAddNuageVspDeviceParams(hostname string, password string, physicalnetworkid string, port int, username string) *AddNuageVspDeviceParams { p := &AddNuageVspDeviceParams{} p.p = make(map[string]interface{}) p.p["hostname"] = hostname p.p["password"] = password p.p["physicalnetworkid"] = physicalnetworkid p.p["port"] = port p.p["username"] = username return p }
[ "func", "(", "s", "*", "NuageVSPService", ")", "NewAddNuageVspDeviceParams", "(", "hostname", "string", ",", "password", "string", ",", "physicalnetworkid", "string", ",", "port", "int", ",", "username", "string", ")", "*", "AddNuageVspDeviceParams", "{", "p", ":=", "&", "AddNuageVspDeviceParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "hostname", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "password", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "physicalnetworkid", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "port", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "username", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new AddNuageVspDeviceParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "AddNuageVspDeviceParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NuageVSPService.go#L130-L139
145,184
xanzy/go-cloudstack
cloudstack/NuageVSPService.go
AddNuageVspDevice
func (s *NuageVSPService) AddNuageVspDevice(p *AddNuageVspDeviceParams) (*AddNuageVspDeviceResponse, error) { resp, err := s.cs.newRequest("addNuageVspDevice", p.toURLValues()) if err != nil { return nil, err } var r AddNuageVspDeviceResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } b, err = getRawValue(b) if err != nil { return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
go
func (s *NuageVSPService) AddNuageVspDevice(p *AddNuageVspDeviceParams) (*AddNuageVspDeviceResponse, error) { resp, err := s.cs.newRequest("addNuageVspDevice", p.toURLValues()) if err != nil { return nil, err } var r AddNuageVspDeviceResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } b, err = getRawValue(b) if err != nil { return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
[ "func", "(", "s", "*", "NuageVSPService", ")", "AddNuageVspDevice", "(", "p", "*", "AddNuageVspDeviceParams", ")", "(", "*", "AddNuageVspDeviceResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "AddNuageVspDeviceResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "// If we have a async client, we need to wait for the async result", "if", "s", ".", "cs", ".", "async", "{", "b", ",", "err", ":=", "s", ".", "cs", ".", "GetAsyncJobResult", "(", "r", ".", "JobID", ",", "s", ".", "cs", ".", "timeout", ")", "\n", "if", "err", "!=", "nil", "{", "if", "err", "==", "AsyncTimeoutErr", "{", "return", "&", "r", ",", "err", "\n", "}", "\n", "return", "nil", ",", "err", "\n", "}", "\n\n", "b", ",", "err", "=", "getRawValue", "(", "b", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "b", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Adds a Nuage VSP device
[ "Adds", "a", "Nuage", "VSP", "device" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NuageVSPService.go#L142-L174
145,185
xanzy/go-cloudstack
cloudstack/NuageVSPService.go
NewDeleteNuageVspDeviceParams
func (s *NuageVSPService) NewDeleteNuageVspDeviceParams(vspdeviceid string) *DeleteNuageVspDeviceParams { p := &DeleteNuageVspDeviceParams{} p.p = make(map[string]interface{}) p.p["vspdeviceid"] = vspdeviceid return p }
go
func (s *NuageVSPService) NewDeleteNuageVspDeviceParams(vspdeviceid string) *DeleteNuageVspDeviceParams { p := &DeleteNuageVspDeviceParams{} p.p = make(map[string]interface{}) p.p["vspdeviceid"] = vspdeviceid return p }
[ "func", "(", "s", "*", "NuageVSPService", ")", "NewDeleteNuageVspDeviceParams", "(", "vspdeviceid", "string", ")", "*", "DeleteNuageVspDeviceParams", "{", "p", ":=", "&", "DeleteNuageVspDeviceParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "vspdeviceid", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new DeleteNuageVspDeviceParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "DeleteNuageVspDeviceParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NuageVSPService.go#L215-L220
145,186
xanzy/go-cloudstack
cloudstack/NuageVSPService.go
DeleteNuageVspDevice
func (s *NuageVSPService) DeleteNuageVspDevice(p *DeleteNuageVspDeviceParams) (*DeleteNuageVspDeviceResponse, error) { resp, err := s.cs.newRequest("deleteNuageVspDevice", p.toURLValues()) if err != nil { return nil, err } var r DeleteNuageVspDeviceResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
go
func (s *NuageVSPService) DeleteNuageVspDevice(p *DeleteNuageVspDeviceParams) (*DeleteNuageVspDeviceResponse, error) { resp, err := s.cs.newRequest("deleteNuageVspDevice", p.toURLValues()) if err != nil { return nil, err } var r DeleteNuageVspDeviceResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
[ "func", "(", "s", "*", "NuageVSPService", ")", "DeleteNuageVspDevice", "(", "p", "*", "DeleteNuageVspDeviceParams", ")", "(", "*", "DeleteNuageVspDeviceResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "DeleteNuageVspDeviceResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "// If we have a async client, we need to wait for the async result", "if", "s", ".", "cs", ".", "async", "{", "b", ",", "err", ":=", "s", ".", "cs", ".", "GetAsyncJobResult", "(", "r", ".", "JobID", ",", "s", ".", "cs", ".", "timeout", ")", "\n", "if", "err", "!=", "nil", "{", "if", "err", "==", "AsyncTimeoutErr", "{", "return", "&", "r", ",", "err", "\n", "}", "\n", "return", "nil", ",", "err", "\n", "}", "\n\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "b", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// delete a nuage vsp device
[ "delete", "a", "nuage", "vsp", "device" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NuageVSPService.go#L223-L250
145,187
xanzy/go-cloudstack
cloudstack/NuageVSPService.go
NewListNuageVspDevicesParams
func (s *NuageVSPService) NewListNuageVspDevicesParams() *ListNuageVspDevicesParams { p := &ListNuageVspDevicesParams{} p.p = make(map[string]interface{}) return p }
go
func (s *NuageVSPService) NewListNuageVspDevicesParams() *ListNuageVspDevicesParams { p := &ListNuageVspDevicesParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "NuageVSPService", ")", "NewListNuageVspDevicesParams", "(", ")", "*", "ListNuageVspDevicesParams", "{", "p", ":=", "&", "ListNuageVspDevicesParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListNuageVspDevicesParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListNuageVspDevicesParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NuageVSPService.go#L329-L333
145,188
xanzy/go-cloudstack
cloudstack/NuageVSPService.go
ListNuageVspDevices
func (s *NuageVSPService) ListNuageVspDevices(p *ListNuageVspDevicesParams) (*ListNuageVspDevicesResponse, error) { resp, err := s.cs.newRequest("listNuageVspDevices", p.toURLValues()) if err != nil { return nil, err } var r ListNuageVspDevicesResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *NuageVSPService) ListNuageVspDevices(p *ListNuageVspDevicesParams) (*ListNuageVspDevicesResponse, error) { resp, err := s.cs.newRequest("listNuageVspDevices", p.toURLValues()) if err != nil { return nil, err } var r ListNuageVspDevicesResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "NuageVSPService", ")", "ListNuageVspDevices", "(", "p", "*", "ListNuageVspDevicesParams", ")", "(", "*", "ListNuageVspDevicesResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "ListNuageVspDevicesResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Lists Nuage VSP devices
[ "Lists", "Nuage", "VSP", "devices" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NuageVSPService.go#L336-L348
145,189
xanzy/go-cloudstack
cloudstack/NuageVSPService.go
NewUpdateNuageVspDeviceParams
func (s *NuageVSPService) NewUpdateNuageVspDeviceParams(physicalnetworkid string) *UpdateNuageVspDeviceParams { p := &UpdateNuageVspDeviceParams{} p.p = make(map[string]interface{}) p.p["physicalnetworkid"] = physicalnetworkid return p }
go
func (s *NuageVSPService) NewUpdateNuageVspDeviceParams(physicalnetworkid string) *UpdateNuageVspDeviceParams { p := &UpdateNuageVspDeviceParams{} p.p = make(map[string]interface{}) p.p["physicalnetworkid"] = physicalnetworkid return p }
[ "func", "(", "s", "*", "NuageVSPService", ")", "NewUpdateNuageVspDeviceParams", "(", "physicalnetworkid", "string", ")", "*", "UpdateNuageVspDeviceParams", "{", "p", ":=", "&", "UpdateNuageVspDeviceParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "physicalnetworkid", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new UpdateNuageVspDeviceParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "UpdateNuageVspDeviceParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NuageVSPService.go#L473-L478
145,190
xanzy/go-cloudstack
cloudstack/NuageVSPService.go
UpdateNuageVspDevice
func (s *NuageVSPService) UpdateNuageVspDevice(p *UpdateNuageVspDeviceParams) (*UpdateNuageVspDeviceResponse, error) { resp, err := s.cs.newRequest("updateNuageVspDevice", p.toURLValues()) if err != nil { return nil, err } var r UpdateNuageVspDeviceResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } b, err = getRawValue(b) if err != nil { return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
go
func (s *NuageVSPService) UpdateNuageVspDevice(p *UpdateNuageVspDeviceParams) (*UpdateNuageVspDeviceResponse, error) { resp, err := s.cs.newRequest("updateNuageVspDevice", p.toURLValues()) if err != nil { return nil, err } var r UpdateNuageVspDeviceResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } // If we have a async client, we need to wait for the async result if s.cs.async { b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout) if err != nil { if err == AsyncTimeoutErr { return &r, err } return nil, err } b, err = getRawValue(b) if err != nil { return nil, err } if err := json.Unmarshal(b, &r); err != nil { return nil, err } } return &r, nil }
[ "func", "(", "s", "*", "NuageVSPService", ")", "UpdateNuageVspDevice", "(", "p", "*", "UpdateNuageVspDeviceParams", ")", "(", "*", "UpdateNuageVspDeviceResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "UpdateNuageVspDeviceResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "// If we have a async client, we need to wait for the async result", "if", "s", ".", "cs", ".", "async", "{", "b", ",", "err", ":=", "s", ".", "cs", ".", "GetAsyncJobResult", "(", "r", ".", "JobID", ",", "s", ".", "cs", ".", "timeout", ")", "\n", "if", "err", "!=", "nil", "{", "if", "err", "==", "AsyncTimeoutErr", "{", "return", "&", "r", ",", "err", "\n", "}", "\n", "return", "nil", ",", "err", "\n", "}", "\n\n", "b", ",", "err", "=", "getRawValue", "(", "b", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "b", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Update a Nuage VSP device
[ "Update", "a", "Nuage", "VSP", "device" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/NuageVSPService.go#L481-L513
145,191
xanzy/go-cloudstack
cloudstack/SecurityGroupService.go
NewAuthorizeSecurityGroupEgressParams
func (s *SecurityGroupService) NewAuthorizeSecurityGroupEgressParams() *AuthorizeSecurityGroupEgressParams { p := &AuthorizeSecurityGroupEgressParams{} p.p = make(map[string]interface{}) return p }
go
func (s *SecurityGroupService) NewAuthorizeSecurityGroupEgressParams() *AuthorizeSecurityGroupEgressParams { p := &AuthorizeSecurityGroupEgressParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "SecurityGroupService", ")", "NewAuthorizeSecurityGroupEgressParams", "(", ")", "*", "AuthorizeSecurityGroupEgressParams", "{", "p", ":=", "&", "AuthorizeSecurityGroupEgressParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new AuthorizeSecurityGroupEgressParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "AuthorizeSecurityGroupEgressParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/SecurityGroupService.go#L215-L219
145,192
xanzy/go-cloudstack
cloudstack/SecurityGroupService.go
NewAuthorizeSecurityGroupIngressParams
func (s *SecurityGroupService) NewAuthorizeSecurityGroupIngressParams() *AuthorizeSecurityGroupIngressParams { p := &AuthorizeSecurityGroupIngressParams{} p.p = make(map[string]interface{}) return p }
go
func (s *SecurityGroupService) NewAuthorizeSecurityGroupIngressParams() *AuthorizeSecurityGroupIngressParams { p := &AuthorizeSecurityGroupIngressParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "SecurityGroupService", ")", "NewAuthorizeSecurityGroupIngressParams", "(", ")", "*", "AuthorizeSecurityGroupIngressParams", "{", "p", ":=", "&", "AuthorizeSecurityGroupIngressParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new AuthorizeSecurityGroupIngressParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "AuthorizeSecurityGroupIngressParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/SecurityGroupService.go#L431-L435
145,193
xanzy/go-cloudstack
cloudstack/SecurityGroupService.go
NewCreateSecurityGroupParams
func (s *SecurityGroupService) NewCreateSecurityGroupParams(name string) *CreateSecurityGroupParams { p := &CreateSecurityGroupParams{} p.p = make(map[string]interface{}) p.p["name"] = name return p }
go
func (s *SecurityGroupService) NewCreateSecurityGroupParams(name string) *CreateSecurityGroupParams { p := &CreateSecurityGroupParams{} p.p = make(map[string]interface{}) p.p["name"] = name return p }
[ "func", "(", "s", "*", "SecurityGroupService", ")", "NewCreateSecurityGroupParams", "(", "name", "string", ")", "*", "CreateSecurityGroupParams", "{", "p", ":=", "&", "CreateSecurityGroupParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "name", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new CreateSecurityGroupParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "CreateSecurityGroupParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/SecurityGroupService.go#L560-L565
145,194
xanzy/go-cloudstack
cloudstack/SecurityGroupService.go
NewDeleteSecurityGroupParams
func (s *SecurityGroupService) NewDeleteSecurityGroupParams() *DeleteSecurityGroupParams { p := &DeleteSecurityGroupParams{} p.p = make(map[string]interface{}) return p }
go
func (s *SecurityGroupService) NewDeleteSecurityGroupParams() *DeleteSecurityGroupParams { p := &DeleteSecurityGroupParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "SecurityGroupService", ")", "NewDeleteSecurityGroupParams", "(", ")", "*", "DeleteSecurityGroupParams", "{", "p", ":=", "&", "DeleteSecurityGroupParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new DeleteSecurityGroupParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "DeleteSecurityGroupParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/SecurityGroupService.go#L684-L688
145,195
xanzy/go-cloudstack
cloudstack/SecurityGroupService.go
NewListSecurityGroupsParams
func (s *SecurityGroupService) NewListSecurityGroupsParams() *ListSecurityGroupsParams { p := &ListSecurityGroupsParams{} p.p = make(map[string]interface{}) return p }
go
func (s *SecurityGroupService) NewListSecurityGroupsParams() *ListSecurityGroupsParams { p := &ListSecurityGroupsParams{} p.p = make(map[string]interface{}) return p }
[ "func", "(", "s", "*", "SecurityGroupService", ")", "NewListSecurityGroupsParams", "(", ")", "*", "ListSecurityGroupsParams", "{", "p", ":=", "&", "ListSecurityGroupsParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new ListSecurityGroupsParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "ListSecurityGroupsParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/SecurityGroupService.go#L884-L888
145,196
xanzy/go-cloudstack
cloudstack/SecurityGroupService.go
NewRevokeSecurityGroupEgressParams
func (s *SecurityGroupService) NewRevokeSecurityGroupEgressParams(id string) *RevokeSecurityGroupEgressParams { p := &RevokeSecurityGroupEgressParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *SecurityGroupService) NewRevokeSecurityGroupEgressParams(id string) *RevokeSecurityGroupEgressParams { p := &RevokeSecurityGroupEgressParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "SecurityGroupService", ")", "NewRevokeSecurityGroupEgressParams", "(", "id", "string", ")", "*", "RevokeSecurityGroupEgressParams", "{", "p", ":=", "&", "RevokeSecurityGroupEgressParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new RevokeSecurityGroupEgressParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "RevokeSecurityGroupEgressParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/SecurityGroupService.go#L1047-L1052
145,197
xanzy/go-cloudstack
cloudstack/SecurityGroupService.go
NewRevokeSecurityGroupIngressParams
func (s *SecurityGroupService) NewRevokeSecurityGroupIngressParams(id string) *RevokeSecurityGroupIngressParams { p := &RevokeSecurityGroupIngressParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
go
func (s *SecurityGroupService) NewRevokeSecurityGroupIngressParams(id string) *RevokeSecurityGroupIngressParams { p := &RevokeSecurityGroupIngressParams{} p.p = make(map[string]interface{}) p.p["id"] = id return p }
[ "func", "(", "s", "*", "SecurityGroupService", ")", "NewRevokeSecurityGroupIngressParams", "(", "id", "string", ")", "*", "RevokeSecurityGroupIngressParams", "{", "p", ":=", "&", "RevokeSecurityGroupIngressParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "id", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new RevokeSecurityGroupIngressParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "RevokeSecurityGroupIngressParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/SecurityGroupService.go#L1115-L1120
145,198
xanzy/go-cloudstack
cloudstack/UsageService.go
NewAddTrafficMonitorParams
func (s *UsageService) NewAddTrafficMonitorParams(url string, zoneid string) *AddTrafficMonitorParams { p := &AddTrafficMonitorParams{} p.p = make(map[string]interface{}) p.p["url"] = url p.p["zoneid"] = zoneid return p }
go
func (s *UsageService) NewAddTrafficMonitorParams(url string, zoneid string) *AddTrafficMonitorParams { p := &AddTrafficMonitorParams{} p.p = make(map[string]interface{}) p.p["url"] = url p.p["zoneid"] = zoneid return p }
[ "func", "(", "s", "*", "UsageService", ")", "NewAddTrafficMonitorParams", "(", "url", "string", ",", "zoneid", "string", ")", "*", "AddTrafficMonitorParams", "{", "p", ":=", "&", "AddTrafficMonitorParams", "{", "}", "\n", "p", ".", "p", "=", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "url", "\n", "p", ".", "p", "[", "\"", "\"", "]", "=", "zoneid", "\n", "return", "p", "\n", "}" ]
// You should always use this function to get a new AddTrafficMonitorParams instance, // as then you are sure you have configured all required params
[ "You", "should", "always", "use", "this", "function", "to", "get", "a", "new", "AddTrafficMonitorParams", "instance", "as", "then", "you", "are", "sure", "you", "have", "configured", "all", "required", "params" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UsageService.go#L84-L90
145,199
xanzy/go-cloudstack
cloudstack/UsageService.go
AddTrafficMonitor
func (s *UsageService) AddTrafficMonitor(p *AddTrafficMonitorParams) (*AddTrafficMonitorResponse, error) { resp, err := s.cs.newRequest("addTrafficMonitor", p.toURLValues()) if err != nil { return nil, err } var r AddTrafficMonitorResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
go
func (s *UsageService) AddTrafficMonitor(p *AddTrafficMonitorParams) (*AddTrafficMonitorResponse, error) { resp, err := s.cs.newRequest("addTrafficMonitor", p.toURLValues()) if err != nil { return nil, err } var r AddTrafficMonitorResponse if err := json.Unmarshal(resp, &r); err != nil { return nil, err } return &r, nil }
[ "func", "(", "s", "*", "UsageService", ")", "AddTrafficMonitor", "(", "p", "*", "AddTrafficMonitorParams", ")", "(", "*", "AddTrafficMonitorResponse", ",", "error", ")", "{", "resp", ",", "err", ":=", "s", ".", "cs", ".", "newRequest", "(", "\"", "\"", ",", "p", ".", "toURLValues", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "r", "AddTrafficMonitorResponse", "\n", "if", "err", ":=", "json", ".", "Unmarshal", "(", "resp", ",", "&", "r", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "&", "r", ",", "nil", "\n", "}" ]
// Adds Traffic Monitor Host for Direct Network Usage
[ "Adds", "Traffic", "Monitor", "Host", "for", "Direct", "Network", "Usage" ]
b6f53ed3282d22b6446422879587b0a78e1b0f11
https://github.com/xanzy/go-cloudstack/blob/b6f53ed3282d22b6446422879587b0a78e1b0f11/cloudstack/UsageService.go#L93-L105