github.com/lirm/aeron-go@v0.0.0-20230415210743-920325491dc4/examples/common.go (about)

     1  /*
     2  Copyright 2016 Stanislav Liberman
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8  http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  package examples
    18  
    19  import (
    20  	"flag"
    21  
    22  	"github.com/lirm/aeron-go/aeron"
    23  )
    24  
    25  var ExamplesConfig = struct {
    26  	AeronPrefix     *string
    27  	ProfilerEnabled *bool
    28  	DriverTo        *int64
    29  	StreamID        *int
    30  	Channel         *string
    31  	Messages        *int
    32  	Size            *int
    33  	LoggingOn       *bool
    34  }{
    35  	flag.String("p", aeron.DefaultAeronDir, "root directory for aeron driver file"),
    36  	flag.Bool("prof", false, "enable CPU profiling"),
    37  	flag.Int64("to", 10000, "driver liveliness timeout in ms"),
    38  	flag.Int("sid", 10, "default streamId to use"),
    39  	flag.String("chan", "aeron:udp?endpoint=localhost:40123", "default channel to subscribe to"),
    40  	flag.Int("m", 1000000, "number of messages to send"),
    41  	flag.Int("len", 256, "messages size"),
    42  	flag.Bool("l", false, "enable logging"),
    43  }
    44  
    45  var PingPongConfig = struct {
    46  	PongStreamID *int
    47  	PingStreamID *int
    48  	PongChannel  *string
    49  	PingChannel  *string
    50  }{
    51  	flag.Int("S", 11, "streamId to use for pong"),
    52  	flag.Int("s", 10, "streamId to use for ping"),
    53  	flag.String("C", "aeron:ipc", "pong channel"),
    54  	flag.String("c", "aeron:ipc", "ping channel"),
    55  }