本文整理汇总了Golang中github.com/petar/GoTeleport/tele/trace.Frame.Refine方法的典型用法代码示例。如果您正苦于以下问题:Golang Frame.Refine方法的具体用法?Golang Frame.Refine怎么用?Golang Frame.Refine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/petar/GoTeleport/tele/trace.Frame
的用法示例。
在下文中一共展示了Frame.Refine方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: NewTransport
func NewTransport(frame trace.Frame, sub *codec.Transport) *Transport {
t := &Transport{
frame: frame,
sub: sub,
Dialer: NewDialer(frame.Refine("dialer"), sub),
}
frame.Bind(t)
return t
}
示例2: NewConn
func NewConn(frame trace.Frame, under *chain.Conn) *Conn {
c := &Conn{
frame: frame,
// Only 1 needed in readLoop; get 3 just to be safe
rch: make(chan interface{}, 3),
// Capacity 1 (below) unblocks writeSync, invoked in readLoop right after a connection stitch
// stitch is received, racing with a user write waiting on waitForLink.
// In particular, if execUserWrite is waiting on waitForLink, it would prevent readLoop from
// moving on to adopt the new connection.
sch: make(chan *control, 1),
ach: make(chan struct{}),
sub: under,
bfr: NewBuffer(frame.Refine("buffer"), MemoryCap),
}
c.frame.Bind(c)
go c.readLoop()
go c.writeLoop() // write loop for user and sync messages
return c
}