-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcontext.go
More file actions
53 lines (42 loc) · 786 Bytes
/
context.go
File metadata and controls
53 lines (42 loc) · 786 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package sdk
import (
"context"
"github.com/tendermint/tendermint/libs/log"
)
type Context struct {
context.Context
lcdURL string
rpcURL string
logger log.Logger
}
func NewCtx(ctx context.Context) Context {
return Context{
Context: ctx,
}
}
func (c Context) Clone(ctx context.Context) Context {
return Context{
Context: ctx,
lcdURL: c.lcdURL,
rpcURL: c.rpcURL,
logger: c.logger,
}
}
func (c Context) WithUrls(lcdURL string, rpcURL string) Context {
c.lcdURL = lcdURL
c.rpcURL = rpcURL
return c
}
func (c Context) WithLogger(logger log.Logger) Context {
c.logger = logger
return c
}
func (c Context) LcdURL() string {
return c.lcdURL
}
func (c Context) RpcURL() string {
return c.rpcURL
}
func (c Context) Logger() log.Logger {
return c.logger
}