blob: cd32f921e346a6fd8564ca2a315a2da1bff21aaa [file] [log] [blame]
Jens Geyerf4598682014-05-08 23:18:44 +02001/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20package main
21
22import (
23 "common"
24 "flag"
25 "log"
26)
27
28var host = flag.String("host", "localhost", "Host to connect")
29var port = flag.Int64("port", 9090, "Port number to connect")
30var domain_socket = flag.String("domain-socket", "", "Domain Socket (e.g. /tmp/ThriftTest.thrift), instead of host and port")
31var transport = flag.String("transport", "buffered", "Transport: buffered, framed, http")
32var protocol = flag.String("protocol", "binary", "Protocol: binary, compact, json")
33var ssl = flag.Bool("ssl", false, "Encrypted Transport using SSL")
34
35func main() {
36 flag.Parse()
37 server, err := common.StartServer(*host, *port, *domain_socket, *transport, *protocol, *ssl, common.PrintingHandler)
38 if err != nil {
39 log.Fatalf("Unable to start server: ", err)
40 }
41 server.Serve()
42}