update selector
This commit is contained in:
@ -4,27 +4,24 @@ import (
|
||||
"context"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/go-gost/core/metadata"
|
||||
)
|
||||
|
||||
type Selectable interface {
|
||||
Marker() Marker
|
||||
Metadata() metadata.Metadata
|
||||
}
|
||||
|
||||
type Selector[T any] interface {
|
||||
Select(context.Context, ...T) T
|
||||
}
|
||||
|
||||
type Strategy[T Selectable] interface {
|
||||
type Strategy[T any] interface {
|
||||
Apply(context.Context, ...T) T
|
||||
}
|
||||
|
||||
type Filter[T Selectable] interface {
|
||||
type Filter[T any] interface {
|
||||
Filter(context.Context, ...T) []T
|
||||
}
|
||||
|
||||
type Markable interface {
|
||||
Marker() Marker
|
||||
}
|
||||
|
||||
type Marker interface {
|
||||
Time() time.Time
|
||||
Count() int64
|
||||
|
Reference in New Issue
Block a user