Setup
bin/kafka-topics.sh \
--zookeeper zookeeper.example.com:2181 \
--create \| // | |
| // This is just a collection of syscalls that are used by libsctp linux implementation. | |
| // Although it supports message-oriented workflow, it can't be wrapped into a net.PacketConn. | |
| // | |
| package main | |
| import ( | |
| "log" | |
| "syscall" |
| func structScan(rows *sql.Rows, model interface{}) error { | |
| v := reflect.ValueOf(model) | |
| if v.Kind() != reflect.Ptr { | |
| return errors.New("must pass a pointer, not a value, to StructScan destination") // @todo add new error message | |
| } | |
| v = reflect.Indirect(v) | |
| t := v.Type() | |
| cols, _ := rows.Columns() |
| package main | |
| import ( | |
| "bytes" | |
| "encoding/hex" | |
| "flag" | |
| "fmt" | |
| "io" | |
| "log" | |
| "net" |
| package main | |
| import ( | |
| "golang.org/x/net/websocket" | |
| "log" | |
| "net/rpc/jsonrpc" | |
| ) | |
| // In a real project, these would be defined in a common file | |
| type Args struct { |
| package main | |
| import ( | |
| //"bufio" | |
| "fmt" | |
| "golang.org/x/net/icmp" | |
| "golang.org/x/net/internal/iana" | |
| "golang.org/x/net/ipv4" | |
| "log" | |
| "net" |
| #!/bin/bash | |
| OUTDIR=. | |
| while read -r db ; do | |
| while read -r table ; do | |
| if [ "$db" == "system" ]; then | |
| echo "skip system db" | |
| continue 2; |
| func ip2int(ip net.IP) uint32 { | |
| if len(ip) == 16 { | |
| return binary.BigEndian.Uint32(ip[12:16]) | |
| } | |
| return binary.BigEndian.Uint32(ip) | |
| } | |
| func int2ip(nn uint32) net.IP { | |
| ip := make(net.IP, 4) | |
| binary.BigEndian.PutUint32(ip, nn) |
| package main | |
| import ( | |
| "flag" | |
| "io" | |
| "log" | |
| "net" | |
| "net/http" | |
| "strings" | |
| ) |
| package main | |
| import ( | |
| "fmt" | |
| "syscall" | |
| "unsafe" | |
| ) | |
| const ( | |
| SCHED_NORMAL = iota |