Small showcase that HTTP Methods are just strings. This enables you to define your own one.
First, create a small demo webserver.
This example is in Go (store the code into a file named main.go
):
package main
import (
"fmt"
Small showcase that HTTP Methods are just strings. This enables you to define your own one.
First, create a small demo webserver.
This example is in Go (store the code into a file named main.go
):
package main
import (
"fmt"
void main() { | |
print("hey"); | |
Map<String, dynamic> response = { | |
'description': Null, | |
}; | |
var tS = BarToString.fromApiResponse(response); | |
print("toString() is working"); | |
print(tS.description); | |
void main() { | |
dynamic foo = Null; | |
String barToString = foo.toString(); | |
print("bar To String"); | |
print(barToString); | |
String barAs = foo as String; | |
print("bar As"); | |
print(barAs); |
➜ mesos-compose git:(master) ✗ docker logs 8ecfac88a254 | |
I0718 06:38:54.030550 4653 main.cpp:264] Build: 2016-06-22 05:18:07 by root | |
I0718 06:38:54.034214 4653 main.cpp:266] Version: 1.0.0 | |
I0718 06:38:54.037546 4653 main.cpp:269] Git tag: 1.0.0-rc1 | |
I0718 06:38:54.037557 4653 main.cpp:273] Git SHA: dfe62665df67162e4c1064f524d6c0180100a9d2 | |
I0718 06:38:54.158023 4653 containerizer.cpp:198] Using isolation: posix/cpu,posix/mem,filesystem/posix,network/cni | |
I0718 06:38:54.175022 4653 linux_launcher.cpp:101] Using /sys/fs/cgroup/freezer as the freezer hierarchy for the Linux launcher | |
2016-07-18 06:38:54,176:4653(0x7f4bb2357700):ZOO_INFO@log_env@726: Client environment:zookeeper.version=zookeeper C client 3.4.8 | |
2016-07-18 06:38:54,181:4653(0x7f4bb2357700):ZOO_INFO@log_env@730: Client environment:host.name=default | |
2016-07-18 06:38:54,181:4653(0x7f4bb2357700):ZOO_INFO@log_env@737: Client environment:os.name=Linux |
ubuntu@ip-172-31-16-197:~/php-redis-server$ cat /proc/meminfo | |
MemTotal: 7659540 kB | |
MemFree: 7163836 kB | |
Buffers: 21796 kB | |
Cached: 344564 kB | |
SwapCached: 0 kB | |
Active: 236116 kB | |
Inactive: 146080 kB | |
Active(anon): 15904 kB | |
Inactive(anon): 284 kB |
ubuntu@ip-172-31-16-197:~/php-redis-server$ cat /proc/cpuinfo | |
processor : 0 | |
vendor_id : GenuineIntel | |
cpu family : 6 | |
model : 63 | |
model name : Intel(R) Xeon(R) CPU E5-2666 v3 @ 2.90GHz | |
stepping : 2 | |
microcode : 0x25 | |
cpu MHz : 2900.044 | |
cache size : 25600 KB |
# -*- coding: utf-8 -*- | |
''' | |
Return data to a redis server | |
To enable this returner the minion will need the python client for redis | |
installed and the following values configured in the minion or master | |
config, these are the defaults: | |
redis.db: '0' | |
redis.host: 'salt' |
# -*- coding: utf-8 -*- | |
import salt.utils | |
# Solve the Chicken and egg problem where grains need to run before any | |
# of the modules are loaded and are generally available for any usage. | |
import salt.modules.cmdmod | |
def redis_version(): | |
''' |
RoomIndex = | |
'Foo': 'Bar Baz Foo Dhi', | |
'Test': 'This is a description' | |
if filter | |
for room, location of RoomIndex when location.toLowerCase().indexOf(filter) != -1 || room.toLowerCase().indexOf(filter) != -1 | |
message.send "#{room}: #{location}" | |
else | |
for room, location of RoomIndex | |
message.send "#{room}: #{location}" |