-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathoptions.go
More file actions
30 lines (26 loc) · 721 Bytes
/
Copy pathoptions.go
File metadata and controls
30 lines (26 loc) · 721 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (c) 2019 Meng Huang (mhboy@outlook.com)
// This package is licensed under a MIT license that can be found in the LICENSE file.
package rpc
import (
"crypto/tls"
"github.com/hslam/socket"
)
//Options defines the struct of options.
type Options struct {
NewSocket func(*tls.Config) socket.Socket
NewCodec func() Codec
NewHeaderEncoder func() Encoder
Network string
Codec string
HeaderEncoder string
TLSConfig *tls.Config
ClientBufferSize int
}
//DefaultOptions returns a default options.
func DefaultOptions() *Options {
return &Options{
NewSocket: socket.NewTCPSocket,
NewCodec: NewJSONCodec,
ClientBufferSize: bufferSize,
}
}