2020-06-02 15:45:21 +00:00
|
|
|
package tribe
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2021-05-05 17:32:45 +00:00
|
|
|
"github.com/tribalwarshelp/shared/tw/twmodel"
|
2020-06-02 15:45:21 +00:00
|
|
|
)
|
|
|
|
|
2020-06-24 13:05:31 +00:00
|
|
|
type FetchConfig struct {
|
|
|
|
Server string
|
2021-05-05 17:32:45 +00:00
|
|
|
Filter *twmodel.TribeFilter
|
2020-06-24 13:05:31 +00:00
|
|
|
Count bool
|
2021-03-21 12:03:39 +00:00
|
|
|
Select bool
|
2020-11-21 11:01:16 +00:00
|
|
|
Sort []string
|
|
|
|
Limit int
|
|
|
|
Offset int
|
2020-06-24 13:05:31 +00:00
|
|
|
}
|
|
|
|
|
2020-12-25 11:07:54 +00:00
|
|
|
type SearchTribeConfig struct {
|
|
|
|
Version string
|
|
|
|
Query string
|
|
|
|
Count bool
|
|
|
|
Sort []string
|
|
|
|
Limit int
|
|
|
|
Offset int
|
|
|
|
}
|
|
|
|
|
2020-06-02 15:45:21 +00:00
|
|
|
type Repository interface {
|
2021-05-05 17:32:45 +00:00
|
|
|
Fetch(ctx context.Context, cfg FetchConfig) ([]*twmodel.Tribe, int, error)
|
|
|
|
SearchTribe(ctx context.Context, cfg SearchTribeConfig) ([]*twmodel.FoundTribe, int, error)
|
2020-06-02 15:45:21 +00:00
|
|
|
}
|