本文整理匯總了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
}