mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-08-02 16:08:31 +00:00
Reformat, fix doc
This commit is contained in:
parent
50e295c834
commit
7be7fc5c3a
7 changed files with 23 additions and 24 deletions
|
@ -12,7 +12,6 @@ import (
|
|||
|
||||
"bitbucket.org/stendec/frankerfacez/socketserver/server"
|
||||
"github.com/clarkduvall/hyperloglog"
|
||||
"github.com/hashicorp/golang-lru"
|
||||
)
|
||||
|
||||
type serverFilter struct {
|
||||
|
|
|
@ -12,11 +12,10 @@ import (
|
|||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"sync"
|
||||
|
||||
"github.com/pmylund/go-cache"
|
||||
cache "github.com/patrickmn/go-cache"
|
||||
"golang.org/x/crypto/nacl/box"
|
||||
)
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ import (
|
|||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package server
|
||||
|
||||
import (
|
||||
"time"
|
||||
"io"
|
||||
"time"
|
||||
)
|
||||
|
||||
// A RateLimit supports a constant number of Performed() calls every
|
||||
|
@ -30,7 +30,7 @@ type timeRateLimit struct{
|
|||
}
|
||||
|
||||
// Construct a new RateLimit with the given count and duration.
|
||||
func NewRateLimit(count int, period time.Duration) (RateLimit) {
|
||||
func NewRateLimit(count int, period time.Duration) RateLimit {
|
||||
return &timeRateLimit{
|
||||
count: count,
|
||||
period: period,
|
||||
|
@ -64,10 +64,11 @@ func (r *timeRateLimit) Close() error {
|
|||
}
|
||||
|
||||
type unlimited struct{}
|
||||
|
||||
var unlimitedInstance unlimited
|
||||
|
||||
// Unlimited returns a RateLimit that never blocks. The Run() and Close() calls are no-ops.
|
||||
func Unlimited() (RateLimit) {
|
||||
func Unlimited() RateLimit {
|
||||
return unlimitedInstance
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package server
|
||||
|
||||
import (
|
||||
"time"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
var exampleData = []string{}
|
||||
|
|
|
@ -108,8 +108,7 @@ type ClientInfo struct {
|
|||
// True if the client has already sent the 'ready' command
|
||||
ReadyComplete bool
|
||||
|
||||
// Server-initiated messages should be sent here
|
||||
// This field will be nil before it is closed.
|
||||
// Server-initiated messages should be sent via the Send() method
|
||||
MessageChannel chan<- ClientMessage
|
||||
|
||||
// Closed when the client is shutting down.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue