mirror of
https://github.com/go-i2p/go-sam-go.git
synced 2025-07-04 10:16:21 -04:00
30 lines
415 B
Go
30 lines
415 B
Go
![]() |
package sam3
|
||
|
|
||
|
import (
|
||
|
"time"
|
||
|
|
||
|
"github.com/go-i2p/go-sam-go/stream"
|
||
|
)
|
||
|
|
||
|
// Represents a streaming session.
|
||
|
type StreamSession struct {
|
||
|
*stream.StreamSession
|
||
|
}
|
||
|
|
||
|
/*
|
||
|
func (s *StreamSession) Cancel() chan *StreamSession {
|
||
|
ch := make(chan *StreamSession)
|
||
|
ch <- s
|
||
|
return ch
|
||
|
}*/
|
||
|
|
||
|
func minNonzeroTime(a, b time.Time) time.Time {
|
||
|
if a.IsZero() {
|
||
|
return b
|
||
|
}
|
||
|
if b.IsZero() || a.Before(b) {
|
||
|
return a
|
||
|
}
|
||
|
return b
|
||
|
}
|