refactor: rename to vanity url
This commit is contained in:
parent
3f3ea4439c
commit
0621e2e815
|
@ -4,12 +4,12 @@ import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/99designs/gqlgen/graphql"
|
"github.com/99designs/gqlgen/graphql"
|
||||||
"github.com/sour-is/ev/app/msgbus"
|
"go.sour.is/ev/app/msgbus"
|
||||||
"github.com/sour-is/ev/app/salty"
|
"go.sour.is/ev/app/salty"
|
||||||
"github.com/sour-is/ev/internal/graph/generated"
|
"go.sour.is/ev/internal/graph/generated"
|
||||||
"github.com/sour-is/ev/pkg/es"
|
"go.sour.is/ev/pkg/es"
|
||||||
"github.com/sour-is/ev/pkg/gql"
|
"go.sour.is/ev/pkg/gql"
|
||||||
"github.com/sour-is/ev/pkg/gql/resolver"
|
"go.sour.is/ev/pkg/gql/resolver"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Resolver struct {
|
type Resolver struct {
|
||||||
|
|
|
@ -5,7 +5,7 @@ extend type Subscription {
|
||||||
"""after == 0 start from begining, after == -1 start from end"""
|
"""after == 0 start from begining, after == -1 start from end"""
|
||||||
postAdded(streamID: String! after: Int! = -1): PostEvent
|
postAdded(streamID: String! after: Int! = -1): PostEvent
|
||||||
}
|
}
|
||||||
type PostEvent implements Edge @goModel(model: "github.com/sour-is/ev/app/msgbus.PostEvent") {
|
type PostEvent implements Edge @goModel(model: "go.sour.is/ev/app/msgbus.PostEvent") {
|
||||||
id: ID!
|
id: ID!
|
||||||
|
|
||||||
payload: String!
|
payload: String!
|
||||||
|
|
|
@ -17,10 +17,10 @@ import (
|
||||||
"go.opentelemetry.io/otel/metric/unit"
|
"go.opentelemetry.io/otel/metric/unit"
|
||||||
"go.uber.org/multierr"
|
"go.uber.org/multierr"
|
||||||
|
|
||||||
"github.com/sour-is/ev"
|
"go.sour.is/ev"
|
||||||
"github.com/sour-is/ev/internal/lg"
|
"go.sour.is/ev/internal/lg"
|
||||||
"github.com/sour-is/ev/pkg/es/event"
|
"go.sour.is/ev/pkg/es/event"
|
||||||
"github.com/sour-is/ev/pkg/gql"
|
"go.sour.is/ev/pkg/gql"
|
||||||
)
|
)
|
||||||
|
|
||||||
type service struct {
|
type service struct {
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
|
|
||||||
"github.com/tj/go-semver"
|
"github.com/tj/go-semver"
|
||||||
|
|
||||||
"github.com/sour-is/ev/pkg/es/event"
|
"go.sour.is/ev/pkg/es/event"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Info struct {
|
type Info struct {
|
||||||
|
|
|
@ -7,8 +7,8 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/keys-pub/keys/json"
|
"github.com/keys-pub/keys/json"
|
||||||
"github.com/sour-is/ev/pkg/es/event"
|
"go.sour.is/ev/pkg/es/event"
|
||||||
"github.com/sour-is/ev/pkg/set"
|
"go.sour.is/ev/pkg/set"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Time time.Time
|
type Time time.Time
|
||||||
|
|
|
@ -9,8 +9,8 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/oklog/ulid"
|
"github.com/oklog/ulid"
|
||||||
"github.com/sour-is/ev/pkg/es/event"
|
"go.sour.is/ev/pkg/es/event"
|
||||||
"github.com/sour-is/ev/pkg/set"
|
"go.sour.is/ev/pkg/set"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Request struct {
|
type Request struct {
|
||||||
|
|
|
@ -19,9 +19,9 @@ import (
|
||||||
contentnegotiation "gitlab.com/jamietanna/content-negotiation-go"
|
contentnegotiation "gitlab.com/jamietanna/content-negotiation-go"
|
||||||
"go.opentelemetry.io/otel/attribute"
|
"go.opentelemetry.io/otel/attribute"
|
||||||
|
|
||||||
"github.com/sour-is/ev"
|
"go.sour.is/ev"
|
||||||
"github.com/sour-is/ev/internal/lg"
|
"go.sour.is/ev/internal/lg"
|
||||||
"github.com/sour-is/ev/pkg/es/event"
|
"go.sour.is/ev/pkg/es/event"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -9,10 +9,10 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/sour-is/ev"
|
"go.sour.is/ev"
|
||||||
"github.com/sour-is/ev/internal/lg"
|
"go.sour.is/ev/internal/lg"
|
||||||
"github.com/sour-is/ev/pkg/es/event"
|
"go.sour.is/ev/pkg/es/event"
|
||||||
"github.com/sour-is/ev/pkg/set"
|
"go.sour.is/ev/pkg/set"
|
||||||
)
|
)
|
||||||
|
|
||||||
// RefreshJob retrieves peer info from the peerdb
|
// RefreshJob retrieves peer info from the peerdb
|
||||||
|
|
|
@ -6,10 +6,10 @@ import (
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/sour-is/ev"
|
"go.sour.is/ev"
|
||||||
"github.com/sour-is/ev/internal/lg"
|
"go.sour.is/ev/internal/lg"
|
||||||
"github.com/sour-is/ev/pkg/es/event"
|
"go.sour.is/ev/pkg/es/event"
|
||||||
"github.com/sour-is/ev/pkg/locker"
|
"go.sour.is/ev/pkg/locker"
|
||||||
"go.uber.org/multierr"
|
"go.uber.org/multierr"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -11,10 +11,10 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/sour-is/ev/internal/lg"
|
|
||||||
"github.com/sour-is/ev/pkg/authreq"
|
|
||||||
"go.opentelemetry.io/otel/metric/instrument"
|
"go.opentelemetry.io/otel/metric/instrument"
|
||||||
"go.opentelemetry.io/otel/metric/instrument/syncint64"
|
"go.opentelemetry.io/otel/metric/instrument/syncint64"
|
||||||
|
"go.sour.is/ev/internal/lg"
|
||||||
|
"go.sour.is/ev/pkg/authreq"
|
||||||
"go.uber.org/multierr"
|
"go.uber.org/multierr"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ import (
|
||||||
|
|
||||||
"github.com/keys-pub/keys"
|
"github.com/keys-pub/keys"
|
||||||
|
|
||||||
"github.com/sour-is/ev/internal/lg"
|
"go.sour.is/ev/internal/lg"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Config represents a Salty Config for a User which at a minimum is required
|
// Config represents a Salty Config for a User which at a minimum is required
|
||||||
|
|
|
@ -12,8 +12,8 @@ import (
|
||||||
"github.com/keys-pub/keys"
|
"github.com/keys-pub/keys"
|
||||||
"github.com/oklog/ulid/v2"
|
"github.com/oklog/ulid/v2"
|
||||||
|
|
||||||
"github.com/sour-is/ev/pkg/es/event"
|
"go.sour.is/ev/pkg/es/event"
|
||||||
"github.com/sour-is/ev/pkg/gql"
|
"go.sour.is/ev/pkg/gql"
|
||||||
)
|
)
|
||||||
|
|
||||||
type SaltyUser struct {
|
type SaltyUser struct {
|
||||||
|
|
|
@ -6,7 +6,7 @@ extend type Mutation {
|
||||||
createSaltyUser(nick: String! pubkey: String!): SaltyUser
|
createSaltyUser(nick: String! pubkey: String!): SaltyUser
|
||||||
}
|
}
|
||||||
|
|
||||||
type SaltyUser @goModel(model: "github.com/sour-is/ev/app/salty.SaltyUser"){
|
type SaltyUser @goModel(model: "go.sour.is/ev/app/salty.SaltyUser"){
|
||||||
pubkey: String!
|
pubkey: String!
|
||||||
inbox: String!
|
inbox: String!
|
||||||
endpoint: String!
|
endpoint: String!
|
||||||
|
|
|
@ -19,10 +19,10 @@ import (
|
||||||
"go.opentelemetry.io/otel/metric/unit"
|
"go.opentelemetry.io/otel/metric/unit"
|
||||||
"go.uber.org/multierr"
|
"go.uber.org/multierr"
|
||||||
|
|
||||||
"github.com/sour-is/ev"
|
"go.sour.is/ev"
|
||||||
"github.com/sour-is/ev/internal/lg"
|
"go.sour.is/ev/internal/lg"
|
||||||
"github.com/sour-is/ev/pkg/es/event"
|
"go.sour.is/ev/pkg/es/event"
|
||||||
"github.com/sour-is/ev/pkg/gql"
|
"go.sour.is/ev/pkg/gql"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DNSResolver interface {
|
type DNSResolver interface {
|
||||||
|
@ -45,7 +45,7 @@ type service struct {
|
||||||
opts []Option
|
opts []Option
|
||||||
}
|
}
|
||||||
|
|
||||||
type Option interface{
|
type Option interface {
|
||||||
ApplySalty(*service)
|
ApplySalty(*service)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ func New(ctx context.Context, es *ev.EventStore, opts ...Option) (*service, erro
|
||||||
for _, o := range opts {
|
for _, o := range opts {
|
||||||
o.ApplySalty(svc)
|
o.ApplySalty(svc)
|
||||||
|
|
||||||
if o, ok:=o.(interface{Setup(context.Context) error}); ok {
|
if o, ok := o.(interface{ Setup(context.Context) error }); ok {
|
||||||
if err := o.Setup(ctx); err != nil {
|
if err := o.Setup(ctx); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -143,7 +143,7 @@ func (s *service) BaseURL() string {
|
||||||
|
|
||||||
func (s *service) RegisterHTTP(mux *http.ServeMux) {
|
func (s *service) RegisterHTTP(mux *http.ServeMux) {
|
||||||
for _, o := range s.opts {
|
for _, o := range s.opts {
|
||||||
if o, ok:=o.(interface{RegisterHTTP(mux *http.ServeMux)}); ok {
|
if o, ok := o.(interface{ RegisterHTTP(mux *http.ServeMux) }); ok {
|
||||||
o.RegisterHTTP(mux)
|
o.RegisterHTTP(mux)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -155,7 +155,7 @@ func (s *service) RegisterAPIv1(mux *http.ServeMux) {
|
||||||
mux.HandleFunc("/send", s.apiv1)
|
mux.HandleFunc("/send", s.apiv1)
|
||||||
|
|
||||||
for _, o := range s.opts {
|
for _, o := range s.opts {
|
||||||
if o, ok:=o.(interface{RegisterAPIv1(mux *http.ServeMux)}); ok {
|
if o, ok := o.(interface{ RegisterAPIv1(mux *http.ServeMux) }); ok {
|
||||||
o.RegisterAPIv1(mux)
|
o.RegisterAPIv1(mux)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -164,7 +164,7 @@ func (s *service) RegisterWellKnown(mux *http.ServeMux) {
|
||||||
mux.Handle("/salty/", lg.Htrace(s, "lookup"))
|
mux.Handle("/salty/", lg.Htrace(s, "lookup"))
|
||||||
|
|
||||||
for _, o := range s.opts {
|
for _, o := range s.opts {
|
||||||
if o, ok:=o.(interface{RegisterWellKnown(mux *http.ServeMux)}); ok {
|
if o, ok := o.(interface{ RegisterWellKnown(mux *http.ServeMux) }); ok {
|
||||||
o.RegisterWellKnown(mux)
|
o.RegisterWellKnown(mux)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ package webfinger
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"github.com/sour-is/ev/pkg/es/event"
|
"go.sour.is/ev/pkg/es/event"
|
||||||
)
|
)
|
||||||
|
|
||||||
type SubjectSet struct {
|
type SubjectSet struct {
|
||||||
|
@ -35,7 +35,7 @@ func (e *SubjectSet) UnmarshalBinary(b []byte) error {
|
||||||
var _ event.Event = (*SubjectSet)(nil)
|
var _ event.Event = (*SubjectSet)(nil)
|
||||||
|
|
||||||
type SubjectDeleted struct {
|
type SubjectDeleted struct {
|
||||||
Subject string `json:"subject"`
|
Subject string `json:"subject"`
|
||||||
|
|
||||||
eventMeta event.Meta
|
eventMeta event.Meta
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,9 +8,9 @@ import (
|
||||||
"hash/fnv"
|
"hash/fnv"
|
||||||
"sort"
|
"sort"
|
||||||
|
|
||||||
"github.com/sour-is/ev/pkg/es/event"
|
"go.sour.is/ev/pkg/es/event"
|
||||||
"github.com/sour-is/ev/pkg/set"
|
"go.sour.is/ev/pkg/set"
|
||||||
"github.com/sour-is/ev/pkg/slice"
|
"go.sour.is/ev/pkg/slice"
|
||||||
"gopkg.in/yaml.v3"
|
"gopkg.in/yaml.v3"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -34,14 +34,14 @@ type JRD struct {
|
||||||
|
|
||||||
func (a *JRD) CloneValues() *JRD {
|
func (a *JRD) CloneValues() *JRD {
|
||||||
m := make(map[string]*string, len(a.Properties))
|
m := make(map[string]*string, len(a.Properties))
|
||||||
for k,v := range a.Properties {
|
for k, v := range a.Properties {
|
||||||
m[k] = v
|
m[k] = v
|
||||||
}
|
}
|
||||||
return &JRD{
|
return &JRD{
|
||||||
Subject: a.Subject,
|
Subject: a.Subject,
|
||||||
Aliases: append([]string{}, a.Aliases...),
|
Aliases: append([]string{}, a.Aliases...),
|
||||||
Properties: m,
|
Properties: m,
|
||||||
Links: append([]*Link{}, a.Links...),
|
Links: append([]*Link{}, a.Links...),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,12 +14,12 @@ import (
|
||||||
"github.com/matryer/is"
|
"github.com/matryer/is"
|
||||||
"go.uber.org/multierr"
|
"go.uber.org/multierr"
|
||||||
|
|
||||||
"github.com/sour-is/ev"
|
"go.sour.is/ev"
|
||||||
"github.com/sour-is/ev/app/webfinger"
|
"go.sour.is/ev/app/webfinger"
|
||||||
memstore "github.com/sour-is/ev/pkg/es/driver/mem-store"
|
memstore "go.sour.is/ev/pkg/es/driver/mem-store"
|
||||||
"github.com/sour-is/ev/pkg/es/driver/projecter"
|
"go.sour.is/ev/pkg/es/driver/projecter"
|
||||||
"github.com/sour-is/ev/pkg/es/driver/streamer"
|
"go.sour.is/ev/pkg/es/driver/streamer"
|
||||||
"github.com/sour-is/ev/pkg/es/event"
|
"go.sour.is/ev/pkg/es/event"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestParseJRD(t *testing.T) {
|
func TestParseJRD(t *testing.T) {
|
||||||
|
|
|
@ -13,10 +13,10 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/golang-jwt/jwt/v4"
|
"github.com/golang-jwt/jwt/v4"
|
||||||
"github.com/sour-is/ev"
|
"go.sour.is/ev"
|
||||||
"github.com/sour-is/ev/internal/lg"
|
"go.sour.is/ev/internal/lg"
|
||||||
"github.com/sour-is/ev/pkg/es/event"
|
"go.sour.is/ev/pkg/es/event"
|
||||||
"github.com/sour-is/ev/pkg/set"
|
"go.sour.is/ev/pkg/set"
|
||||||
)
|
)
|
||||||
|
|
||||||
type service struct {
|
type service struct {
|
||||||
|
|
|
@ -4,11 +4,11 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/sour-is/ev"
|
"go.sour.is/ev"
|
||||||
"github.com/sour-is/ev/app/msgbus"
|
"go.sour.is/ev/app/msgbus"
|
||||||
"github.com/sour-is/ev/internal/lg"
|
"go.sour.is/ev/internal/lg"
|
||||||
"github.com/sour-is/ev/pkg/service"
|
"go.sour.is/ev/pkg/service"
|
||||||
"github.com/sour-is/ev/pkg/slice"
|
"go.sour.is/ev/pkg/slice"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = apps.Register(50, func(ctx context.Context, svc *service.Harness) error {
|
var _ = apps.Register(50, func(ctx context.Context, svc *service.Harness) error {
|
||||||
|
|
|
@ -4,13 +4,13 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/sour-is/ev"
|
"go.sour.is/ev"
|
||||||
"github.com/sour-is/ev/app/peerfinder"
|
"go.sour.is/ev/app/peerfinder"
|
||||||
"github.com/sour-is/ev/internal/lg"
|
"go.sour.is/ev/internal/lg"
|
||||||
"github.com/sour-is/ev/pkg/env"
|
"go.sour.is/ev/pkg/env"
|
||||||
"github.com/sour-is/ev/pkg/es/driver/projecter"
|
"go.sour.is/ev/pkg/es/driver/projecter"
|
||||||
"github.com/sour-is/ev/pkg/service"
|
"go.sour.is/ev/pkg/service"
|
||||||
"github.com/sour-is/ev/pkg/slice"
|
"go.sour.is/ev/pkg/slice"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = apps.Register(50, func(ctx context.Context, svc *service.Harness) error {
|
var _ = apps.Register(50, func(ctx context.Context, svc *service.Harness) error {
|
||||||
|
|
|
@ -9,12 +9,12 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/sour-is/ev"
|
"go.sour.is/ev"
|
||||||
"github.com/sour-is/ev/app/salty"
|
"go.sour.is/ev/app/salty"
|
||||||
"github.com/sour-is/ev/internal/lg"
|
"go.sour.is/ev/internal/lg"
|
||||||
"github.com/sour-is/ev/pkg/env"
|
"go.sour.is/ev/pkg/env"
|
||||||
"github.com/sour-is/ev/pkg/service"
|
"go.sour.is/ev/pkg/service"
|
||||||
"github.com/sour-is/ev/pkg/slice"
|
"go.sour.is/ev/pkg/slice"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = apps.Register(50, func(ctx context.Context, svc *service.Harness) error {
|
var _ = apps.Register(50, func(ctx context.Context, svc *service.Harness) error {
|
||||||
|
|
|
@ -7,12 +7,12 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/patrickmn/go-cache"
|
"github.com/patrickmn/go-cache"
|
||||||
"github.com/sour-is/ev"
|
"go.sour.is/ev"
|
||||||
"github.com/sour-is/ev/app/webfinger"
|
"go.sour.is/ev/app/webfinger"
|
||||||
"github.com/sour-is/ev/internal/lg"
|
"go.sour.is/ev/internal/lg"
|
||||||
"github.com/sour-is/ev/pkg/env"
|
"go.sour.is/ev/pkg/env"
|
||||||
"github.com/sour-is/ev/pkg/service"
|
"go.sour.is/ev/pkg/service"
|
||||||
"github.com/sour-is/ev/pkg/slice"
|
"go.sour.is/ev/pkg/slice"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -8,8 +8,8 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
|
|
||||||
"github.com/sour-is/ev/internal/lg"
|
"go.sour.is/ev/internal/lg"
|
||||||
"github.com/sour-is/ev/pkg/service"
|
"go.sour.is/ev/pkg/service"
|
||||||
)
|
)
|
||||||
|
|
||||||
var apps service.Apps
|
var apps service.Apps
|
||||||
|
|
|
@ -3,17 +3,17 @@ package main
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/sour-is/ev"
|
"go.sour.is/ev"
|
||||||
"github.com/sour-is/ev/internal/lg"
|
"go.sour.is/ev/internal/lg"
|
||||||
"github.com/sour-is/ev/pkg/env"
|
"go.sour.is/ev/pkg/env"
|
||||||
"github.com/sour-is/ev/pkg/es"
|
"go.sour.is/ev/pkg/es"
|
||||||
diskstore "github.com/sour-is/ev/pkg/es/driver/disk-store"
|
diskstore "go.sour.is/ev/pkg/es/driver/disk-store"
|
||||||
memstore "github.com/sour-is/ev/pkg/es/driver/mem-store"
|
memstore "go.sour.is/ev/pkg/es/driver/mem-store"
|
||||||
"github.com/sour-is/ev/pkg/es/driver/projecter"
|
"go.sour.is/ev/pkg/es/driver/projecter"
|
||||||
resolvelinks "github.com/sour-is/ev/pkg/es/driver/resolve-links"
|
resolvelinks "go.sour.is/ev/pkg/es/driver/resolve-links"
|
||||||
"github.com/sour-is/ev/pkg/es/driver/streamer"
|
"go.sour.is/ev/pkg/es/driver/streamer"
|
||||||
"github.com/sour-is/ev/pkg/es/event"
|
"go.sour.is/ev/pkg/es/event"
|
||||||
"github.com/sour-is/ev/pkg/service"
|
"go.sour.is/ev/pkg/service"
|
||||||
"go.uber.org/multierr"
|
"go.uber.org/multierr"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -4,12 +4,12 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/sour-is/ev/app/gql"
|
"go.sour.is/ev/app/gql"
|
||||||
"github.com/sour-is/ev/internal/lg"
|
"go.sour.is/ev/internal/lg"
|
||||||
"github.com/sour-is/ev/pkg/gql/resolver"
|
"go.sour.is/ev/pkg/gql/resolver"
|
||||||
"github.com/sour-is/ev/pkg/mux"
|
"go.sour.is/ev/pkg/mux"
|
||||||
"github.com/sour-is/ev/pkg/service"
|
"go.sour.is/ev/pkg/service"
|
||||||
"github.com/sour-is/ev/pkg/slice"
|
"go.sour.is/ev/pkg/slice"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = apps.Register(90, func(ctx context.Context, svc *service.Harness) error {
|
var _ = apps.Register(90, func(ctx context.Context, svc *service.Harness) error {
|
||||||
|
|
|
@ -7,17 +7,15 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/rs/cors"
|
"github.com/rs/cors"
|
||||||
"github.com/sour-is/ev/internal/lg"
|
"go.sour.is/ev/internal/lg"
|
||||||
"github.com/sour-is/ev/pkg/env"
|
"go.sour.is/ev/pkg/env"
|
||||||
"github.com/sour-is/ev/pkg/mux"
|
"go.sour.is/ev/pkg/mux"
|
||||||
"github.com/sour-is/ev/pkg/service"
|
"go.sour.is/ev/pkg/service"
|
||||||
"github.com/sour-is/ev/pkg/slice"
|
"go.sour.is/ev/pkg/slice"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = apps.Register(20, func(ctx context.Context, svc *service.Harness) error {
|
var _ = apps.Register(20, func(ctx context.Context, svc *service.Harness) error {
|
||||||
s := &http.Server{
|
s := &http.Server{}
|
||||||
|
|
||||||
}
|
|
||||||
svc.Add(s)
|
svc.Add(s)
|
||||||
|
|
||||||
mux := mux.New()
|
mux := mux.New()
|
||||||
|
|
|
@ -18,8 +18,8 @@ import (
|
||||||
"github.com/docopt/docopt-go"
|
"github.com/docopt/docopt-go"
|
||||||
"gopkg.in/yaml.v3"
|
"gopkg.in/yaml.v3"
|
||||||
|
|
||||||
"github.com/sour-is/ev/app/webfinger"
|
"go.sour.is/ev/app/webfinger"
|
||||||
"github.com/sour-is/ev/cmd/webfinger-cli/xdg"
|
"go.sour.is/ev/cmd/webfinger-cli/xdg"
|
||||||
)
|
)
|
||||||
|
|
||||||
var usage = `Webfinger CLI.
|
var usage = `Webfinger CLI.
|
||||||
|
|
|
@ -11,8 +11,8 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/matryer/is"
|
"github.com/matryer/is"
|
||||||
"github.com/sour-is/ev/app/webfinger"
|
"go.sour.is/ev/app/webfinger"
|
||||||
"github.com/sour-is/ev/pkg/service"
|
"go.sour.is/ev/pkg/service"
|
||||||
"golang.org/x/sync/errgroup"
|
"golang.org/x/sync/errgroup"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
8
ev.go
8
ev.go
|
@ -11,10 +11,10 @@ import (
|
||||||
"go.opentelemetry.io/otel/metric/instrument/syncint64"
|
"go.opentelemetry.io/otel/metric/instrument/syncint64"
|
||||||
"go.uber.org/multierr"
|
"go.uber.org/multierr"
|
||||||
|
|
||||||
"github.com/sour-is/ev/internal/lg"
|
"go.sour.is/ev/internal/lg"
|
||||||
"github.com/sour-is/ev/pkg/es/driver"
|
"go.sour.is/ev/pkg/es/driver"
|
||||||
"github.com/sour-is/ev/pkg/es/event"
|
"go.sour.is/ev/pkg/es/event"
|
||||||
"github.com/sour-is/ev/pkg/locker"
|
"go.sour.is/ev/pkg/locker"
|
||||||
)
|
)
|
||||||
|
|
||||||
type config struct {
|
type config struct {
|
||||||
|
|
14
ev_test.go
14
ev_test.go
|
@ -11,13 +11,13 @@ import (
|
||||||
"github.com/matryer/is"
|
"github.com/matryer/is"
|
||||||
"go.uber.org/multierr"
|
"go.uber.org/multierr"
|
||||||
|
|
||||||
"github.com/sour-is/ev"
|
"go.sour.is/ev"
|
||||||
"github.com/sour-is/ev/app/peerfinder"
|
"go.sour.is/ev/app/peerfinder"
|
||||||
memstore "github.com/sour-is/ev/pkg/es/driver/mem-store"
|
memstore "go.sour.is/ev/pkg/es/driver/mem-store"
|
||||||
"github.com/sour-is/ev/pkg/es/driver/projecter"
|
"go.sour.is/ev/pkg/es/driver/projecter"
|
||||||
resolvelinks "github.com/sour-is/ev/pkg/es/driver/resolve-links"
|
resolvelinks "go.sour.is/ev/pkg/es/driver/resolve-links"
|
||||||
"github.com/sour-is/ev/pkg/es/driver/streamer"
|
"go.sour.is/ev/pkg/es/driver/streamer"
|
||||||
"github.com/sour-is/ev/pkg/es/event"
|
"go.sour.is/ev/pkg/es/event"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -16,11 +16,11 @@ import (
|
||||||
"github.com/99designs/gqlgen/graphql"
|
"github.com/99designs/gqlgen/graphql"
|
||||||
"github.com/99designs/gqlgen/graphql/introspection"
|
"github.com/99designs/gqlgen/graphql/introspection"
|
||||||
"github.com/99designs/gqlgen/plugin/federation/fedruntime"
|
"github.com/99designs/gqlgen/plugin/federation/fedruntime"
|
||||||
"github.com/sour-is/ev/app/msgbus"
|
"go.sour.is/ev/app/msgbus"
|
||||||
"github.com/sour-is/ev/app/salty"
|
"go.sour.is/ev/app/salty"
|
||||||
"github.com/sour-is/ev/pkg/es"
|
"go.sour.is/ev/pkg/es"
|
||||||
"github.com/sour-is/ev/pkg/es/event"
|
"go.sour.is/ev/pkg/es/event"
|
||||||
"github.com/sour-is/ev/pkg/gql"
|
"go.sour.is/ev/pkg/gql"
|
||||||
gqlparser "github.com/vektah/gqlparser/v2"
|
gqlparser "github.com/vektah/gqlparser/v2"
|
||||||
"github.com/vektah/gqlparser/v2/ast"
|
"github.com/vektah/gqlparser/v2/ast"
|
||||||
)
|
)
|
||||||
|
@ -530,7 +530,7 @@ func (ec *executionContext) introspectType(name string) (*introspection.Type, er
|
||||||
|
|
||||||
var sources = []*ast.Source{
|
var sources = []*ast.Source{
|
||||||
{Name: "../../../pkg/es/es.graphqls", Input: `
|
{Name: "../../../pkg/es/es.graphqls", Input: `
|
||||||
type Meta @goModel(model: "github.com/sour-is/ev/pkg/es/event.Meta") {
|
type Meta @goModel(model: "go.sour.is/ev/pkg/es/event.Meta") {
|
||||||
eventID: String! @goField(name: "getEventID")
|
eventID: String! @goField(name: "getEventID")
|
||||||
streamID: String! @goField(name: "ActualStreamID")
|
streamID: String! @goField(name: "ActualStreamID")
|
||||||
position: Int! @goField(name: "ActualPosition")
|
position: Int! @goField(name: "ActualPosition")
|
||||||
|
@ -548,7 +548,7 @@ extend type Subscription {
|
||||||
eventAdded(streamID: String! after: Int! = -1): Event
|
eventAdded(streamID: String! after: Int! = -1): Event
|
||||||
}
|
}
|
||||||
|
|
||||||
type Event implements Edge @goModel(model: "github.com/sour-is/ev/pkg/es.GQLEvent") {
|
type Event implements Edge @goModel(model: "go.sour.is/ev/pkg/es.GQLEvent") {
|
||||||
id: ID!
|
id: ID!
|
||||||
|
|
||||||
eventID: String!
|
eventID: String!
|
||||||
|
@ -566,23 +566,23 @@ type Event implements Edge @goModel(model: "github.com/sour-is/ev/pkg/es.GQLEven
|
||||||
{Name: "../../../pkg/gql/common.graphqls", Input: `scalar Time
|
{Name: "../../../pkg/gql/common.graphqls", Input: `scalar Time
|
||||||
scalar Map
|
scalar Map
|
||||||
|
|
||||||
type Connection @goModel(model: "github.com/sour-is/ev/pkg/gql.Connection") {
|
type Connection @goModel(model: "go.sour.is/ev/pkg/gql.Connection") {
|
||||||
paging: PageInfo!
|
paging: PageInfo!
|
||||||
edges: [Edge!]!
|
edges: [Edge!]!
|
||||||
}
|
}
|
||||||
input PageInput @goModel(model: "github.com/sour-is/ev/pkg/gql.PageInput") {
|
input PageInput @goModel(model: "go.sour.is/ev/pkg/gql.PageInput") {
|
||||||
after: Int = 0
|
after: Int = 0
|
||||||
before: Int
|
before: Int
|
||||||
count: Int = 30
|
count: Int = 30
|
||||||
}
|
}
|
||||||
type PageInfo @goModel(model: "github.com/sour-is/ev/pkg/gql.PageInfo") {
|
type PageInfo @goModel(model: "go.sour.is/ev/pkg/gql.PageInfo") {
|
||||||
next: Boolean!
|
next: Boolean!
|
||||||
prev: Boolean!
|
prev: Boolean!
|
||||||
|
|
||||||
begin: Int!
|
begin: Int!
|
||||||
end: Int!
|
end: Int!
|
||||||
}
|
}
|
||||||
interface Edge @goModel(model: "github.com/sour-is/ev/pkg/gql.Edge"){
|
interface Edge @goModel(model: "go.sour.is/ev/pkg/gql.Edge"){
|
||||||
id: ID!
|
id: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -615,7 +615,7 @@ extend type Subscription {
|
||||||
"""after == 0 start from begining, after == -1 start from end"""
|
"""after == 0 start from begining, after == -1 start from end"""
|
||||||
postAdded(streamID: String! after: Int! = -1): PostEvent
|
postAdded(streamID: String! after: Int! = -1): PostEvent
|
||||||
}
|
}
|
||||||
type PostEvent implements Edge @goModel(model: "github.com/sour-is/ev/app/msgbus.PostEvent") {
|
type PostEvent implements Edge @goModel(model: "go.sour.is/ev/app/msgbus.PostEvent") {
|
||||||
id: ID!
|
id: ID!
|
||||||
|
|
||||||
payload: String!
|
payload: String!
|
||||||
|
@ -632,7 +632,7 @@ extend type Mutation {
|
||||||
createSaltyUser(nick: String! pubkey: String!): SaltyUser
|
createSaltyUser(nick: String! pubkey: String!): SaltyUser
|
||||||
}
|
}
|
||||||
|
|
||||||
type SaltyUser @goModel(model: "github.com/sour-is/ev/app/salty.SaltyUser"){
|
type SaltyUser @goModel(model: "go.sour.is/ev/app/salty.SaltyUser"){
|
||||||
pubkey: String!
|
pubkey: String!
|
||||||
inbox: String!
|
inbox: String!
|
||||||
endpoint: String!
|
endpoint: String!
|
||||||
|
|
|
@ -5,11 +5,11 @@ package resolver
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/sour-is/ev/app/msgbus"
|
"go.sour.is/ev/app/msgbus"
|
||||||
"github.com/sour-is/ev/app/salty"
|
"go.sour.is/ev/app/salty"
|
||||||
"github.com/sour-is/ev/internal/graph/generated"
|
"go.sour.is/ev/internal/graph/generated"
|
||||||
"github.com/sour-is/ev/pkg/es"
|
"go.sour.is/ev/pkg/es"
|
||||||
"github.com/sour-is/ev/pkg/gql"
|
"go.sour.is/ev/pkg/gql"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Resolver struct{}
|
type Resolver struct{}
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/matryer/is"
|
"github.com/matryer/is"
|
||||||
"github.com/sour-is/ev/pkg/authreq"
|
"go.sour.is/ev/pkg/authreq"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestGETRequest(t *testing.T) {
|
func TestGETRequest(t *testing.T) {
|
||||||
|
|
2
pkg/cache/cache_test.go
vendored
2
pkg/cache/cache_test.go
vendored
|
@ -5,7 +5,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/matryer/is"
|
"github.com/matryer/is"
|
||||||
"github.com/sour-is/ev/pkg/cache"
|
"go.sour.is/ev/pkg/cache"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCache(t *testing.T) {
|
func TestCache(t *testing.T) {
|
||||||
|
|
|
@ -8,10 +8,10 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/sour-is/ev/internal/lg"
|
|
||||||
"github.com/sour-is/ev/pkg/locker"
|
|
||||||
"github.com/sour-is/ev/pkg/set"
|
|
||||||
"go.opentelemetry.io/otel/attribute"
|
"go.opentelemetry.io/otel/attribute"
|
||||||
|
"go.sour.is/ev/internal/lg"
|
||||||
|
"go.sour.is/ev/pkg/locker"
|
||||||
|
"go.sour.is/ev/pkg/set"
|
||||||
"golang.org/x/sync/errgroup"
|
"golang.org/x/sync/errgroup"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -16,13 +16,13 @@ import (
|
||||||
"go.opentelemetry.io/otel/metric/instrument/syncint64"
|
"go.opentelemetry.io/otel/metric/instrument/syncint64"
|
||||||
"go.uber.org/multierr"
|
"go.uber.org/multierr"
|
||||||
|
|
||||||
"github.com/sour-is/ev"
|
"go.sour.is/ev"
|
||||||
"github.com/sour-is/ev/internal/lg"
|
"go.sour.is/ev/internal/lg"
|
||||||
"github.com/sour-is/ev/pkg/cache"
|
"go.sour.is/ev/pkg/cache"
|
||||||
"github.com/sour-is/ev/pkg/es/driver"
|
"go.sour.is/ev/pkg/es/driver"
|
||||||
"github.com/sour-is/ev/pkg/es/event"
|
"go.sour.is/ev/pkg/es/event"
|
||||||
"github.com/sour-is/ev/pkg/locker"
|
"go.sour.is/ev/pkg/locker"
|
||||||
"github.com/sour-is/ev/pkg/math"
|
"go.sour.is/ev/pkg/math"
|
||||||
)
|
)
|
||||||
|
|
||||||
const CachSize = 1000
|
const CachSize = 1000
|
||||||
|
|
|
@ -4,7 +4,7 @@ package driver
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/sour-is/ev/pkg/es/event"
|
"go.sour.is/ev/pkg/es/event"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Driver interface {
|
type Driver interface {
|
||||||
|
|
|
@ -5,12 +5,12 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/sour-is/ev"
|
"go.sour.is/ev"
|
||||||
"github.com/sour-is/ev/internal/lg"
|
"go.sour.is/ev/internal/lg"
|
||||||
"github.com/sour-is/ev/pkg/es/driver"
|
"go.sour.is/ev/pkg/es/driver"
|
||||||
"github.com/sour-is/ev/pkg/es/event"
|
"go.sour.is/ev/pkg/es/event"
|
||||||
"github.com/sour-is/ev/pkg/locker"
|
"go.sour.is/ev/pkg/locker"
|
||||||
"github.com/sour-is/ev/pkg/math"
|
"go.sour.is/ev/pkg/math"
|
||||||
)
|
)
|
||||||
|
|
||||||
type state struct {
|
type state struct {
|
||||||
|
|
|
@ -5,10 +5,10 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/sour-is/ev"
|
"go.sour.is/ev"
|
||||||
"github.com/sour-is/ev/internal/lg"
|
"go.sour.is/ev/internal/lg"
|
||||||
"github.com/sour-is/ev/pkg/es/driver"
|
"go.sour.is/ev/pkg/es/driver"
|
||||||
"github.com/sour-is/ev/pkg/es/event"
|
"go.sour.is/ev/pkg/es/event"
|
||||||
)
|
)
|
||||||
|
|
||||||
type projector struct {
|
type projector struct {
|
||||||
|
|
|
@ -5,10 +5,10 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/matryer/is"
|
"github.com/matryer/is"
|
||||||
"github.com/sour-is/ev"
|
"go.sour.is/ev"
|
||||||
"github.com/sour-is/ev/pkg/es/driver"
|
"go.sour.is/ev/pkg/es/driver"
|
||||||
"github.com/sour-is/ev/pkg/es/driver/projecter"
|
"go.sour.is/ev/pkg/es/driver/projecter"
|
||||||
"github.com/sour-is/ev/pkg/es/event"
|
"go.sour.is/ev/pkg/es/event"
|
||||||
)
|
)
|
||||||
|
|
||||||
type mockDriver struct {
|
type mockDriver struct {
|
||||||
|
|
|
@ -4,10 +4,10 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"github.com/sour-is/ev"
|
"go.sour.is/ev"
|
||||||
"github.com/sour-is/ev/internal/lg"
|
"go.sour.is/ev/internal/lg"
|
||||||
"github.com/sour-is/ev/pkg/es/driver"
|
"go.sour.is/ev/pkg/es/driver"
|
||||||
"github.com/sour-is/ev/pkg/es/event"
|
"go.sour.is/ev/pkg/es/event"
|
||||||
)
|
)
|
||||||
|
|
||||||
type resolvelinks struct {
|
type resolvelinks struct {
|
||||||
|
|
|
@ -9,11 +9,11 @@ import (
|
||||||
"go.opentelemetry.io/otel/attribute"
|
"go.opentelemetry.io/otel/attribute"
|
||||||
"go.opentelemetry.io/otel/trace"
|
"go.opentelemetry.io/otel/trace"
|
||||||
|
|
||||||
"github.com/sour-is/ev"
|
"go.sour.is/ev"
|
||||||
"github.com/sour-is/ev/internal/lg"
|
"go.sour.is/ev/internal/lg"
|
||||||
"github.com/sour-is/ev/pkg/es/driver"
|
"go.sour.is/ev/pkg/es/driver"
|
||||||
"github.com/sour-is/ev/pkg/es/event"
|
"go.sour.is/ev/pkg/es/event"
|
||||||
"github.com/sour-is/ev/pkg/locker"
|
"go.sour.is/ev/pkg/locker"
|
||||||
)
|
)
|
||||||
|
|
||||||
type state struct {
|
type state struct {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
type Meta @goModel(model: "github.com/sour-is/ev/pkg/es/event.Meta") {
|
type Meta @goModel(model: "go.sour.is/ev/pkg/es/event.Meta") {
|
||||||
eventID: String! @goField(name: "getEventID")
|
eventID: String! @goField(name: "getEventID")
|
||||||
streamID: String! @goField(name: "ActualStreamID")
|
streamID: String! @goField(name: "ActualStreamID")
|
||||||
position: Int! @goField(name: "ActualPosition")
|
position: Int! @goField(name: "ActualPosition")
|
||||||
|
@ -17,7 +17,7 @@ extend type Subscription {
|
||||||
eventAdded(streamID: String! after: Int! = -1): Event
|
eventAdded(streamID: String! after: Int! = -1): Event
|
||||||
}
|
}
|
||||||
|
|
||||||
type Event implements Edge @goModel(model: "github.com/sour-is/ev/pkg/es.GQLEvent") {
|
type Event implements Edge @goModel(model: "go.sour.is/ev/pkg/es.GQLEvent") {
|
||||||
id: ID!
|
id: ID!
|
||||||
|
|
||||||
eventID: String!
|
eventID: String!
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/sour-is/ev/pkg/es/event"
|
"go.sour.is/ev/pkg/es/event"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Agg struct {
|
type Agg struct {
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
|
|
||||||
"github.com/matryer/is"
|
"github.com/matryer/is"
|
||||||
|
|
||||||
"github.com/sour-is/ev/pkg/es/event"
|
"go.sour.is/ev/pkg/es/event"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DummyEvent struct {
|
type DummyEvent struct {
|
||||||
|
|
|
@ -9,8 +9,8 @@ import (
|
||||||
"reflect"
|
"reflect"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/sour-is/ev/internal/lg"
|
"go.sour.is/ev/internal/lg"
|
||||||
"github.com/sour-is/ev/pkg/locker"
|
"go.sour.is/ev/pkg/locker"
|
||||||
)
|
)
|
||||||
|
|
||||||
type config struct {
|
type config struct {
|
||||||
|
|
|
@ -7,10 +7,10 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/sour-is/ev"
|
"go.sour.is/ev"
|
||||||
"github.com/sour-is/ev/internal/lg"
|
"go.sour.is/ev/internal/lg"
|
||||||
"github.com/sour-is/ev/pkg/es/event"
|
"go.sour.is/ev/pkg/es/event"
|
||||||
"github.com/sour-is/ev/pkg/gql"
|
"go.sour.is/ev/pkg/gql"
|
||||||
)
|
)
|
||||||
|
|
||||||
type EventResolver interface {
|
type EventResolver interface {
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
scalar Time
|
scalar Time
|
||||||
scalar Map
|
scalar Map
|
||||||
|
|
||||||
type Connection @goModel(model: "github.com/sour-is/ev/pkg/gql.Connection") {
|
type Connection @goModel(model: "go.sour.is/ev/pkg/gql.Connection") {
|
||||||
paging: PageInfo!
|
paging: PageInfo!
|
||||||
edges: [Edge!]!
|
edges: [Edge!]!
|
||||||
}
|
}
|
||||||
input PageInput @goModel(model: "github.com/sour-is/ev/pkg/gql.PageInput") {
|
input PageInput @goModel(model: "go.sour.is/ev/pkg/gql.PageInput") {
|
||||||
after: Int = 0
|
after: Int = 0
|
||||||
before: Int
|
before: Int
|
||||||
count: Int = 30
|
count: Int = 30
|
||||||
}
|
}
|
||||||
type PageInfo @goModel(model: "github.com/sour-is/ev/pkg/gql.PageInfo") {
|
type PageInfo @goModel(model: "go.sour.is/ev/pkg/gql.PageInfo") {
|
||||||
next: Boolean!
|
next: Boolean!
|
||||||
prev: Boolean!
|
prev: Boolean!
|
||||||
|
|
||||||
begin: Int!
|
begin: Int!
|
||||||
end: Int!
|
end: Int!
|
||||||
}
|
}
|
||||||
interface Edge @goModel(model: "github.com/sour-is/ev/pkg/gql.Edge"){
|
interface Edge @goModel(model: "go.sour.is/ev/pkg/gql.Edge"){
|
||||||
id: ID!
|
id: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"github.com/sour-is/ev/pkg/es/event"
|
"go.sour.is/ev/pkg/es/event"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Edge interface {
|
type Edge interface {
|
||||||
|
|
|
@ -19,9 +19,9 @@ import (
|
||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
"github.com/ravilushqa/otelgqlgen"
|
"github.com/ravilushqa/otelgqlgen"
|
||||||
|
|
||||||
"github.com/sour-is/ev/internal/lg"
|
"go.sour.is/ev/internal/lg"
|
||||||
"github.com/sour-is/ev/pkg/gql/graphiql"
|
"go.sour.is/ev/pkg/gql/graphiql"
|
||||||
"github.com/sour-is/ev/pkg/gql/playground"
|
"go.sour.is/ev/pkg/gql/playground"
|
||||||
)
|
)
|
||||||
|
|
||||||
type BaseResolver interface {
|
type BaseResolver interface {
|
||||||
|
|
|
@ -4,8 +4,8 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/sour-is/ev/internal/lg"
|
|
||||||
"go.opentelemetry.io/otel/attribute"
|
"go.opentelemetry.io/otel/attribute"
|
||||||
|
"go.sour.is/ev/internal/lg"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Locked[T any] struct {
|
type Locked[T any] struct {
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
|
|
||||||
"github.com/matryer/is"
|
"github.com/matryer/is"
|
||||||
|
|
||||||
"github.com/sour-is/ev/pkg/locker"
|
"go.sour.is/ev/pkg/locker"
|
||||||
)
|
)
|
||||||
|
|
||||||
type config struct {
|
type config struct {
|
||||||
|
|
|
@ -4,8 +4,8 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/matryer/is"
|
"github.com/matryer/is"
|
||||||
"github.com/sour-is/ev"
|
"go.sour.is/ev"
|
||||||
"github.com/sour-is/ev/pkg/math"
|
"go.sour.is/ev/pkg/math"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestMath(t *testing.T) {
|
func TestMath(t *testing.T) {
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/matryer/is"
|
"github.com/matryer/is"
|
||||||
"github.com/sour-is/ev/pkg/mux"
|
"go.sour.is/ev/pkg/mux"
|
||||||
)
|
)
|
||||||
|
|
||||||
type mockHTTP struct {
|
type mockHTTP struct {
|
||||||
|
|
|
@ -9,9 +9,9 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/sour-is/ev/internal/lg"
|
|
||||||
"github.com/sour-is/ev/pkg/cron"
|
|
||||||
"go.opentelemetry.io/otel/attribute"
|
"go.opentelemetry.io/otel/attribute"
|
||||||
|
"go.sour.is/ev/internal/lg"
|
||||||
|
"go.sour.is/ev/pkg/cron"
|
||||||
"go.uber.org/multierr"
|
"go.uber.org/multierr"
|
||||||
"golang.org/x/sync/errgroup"
|
"golang.org/x/sync/errgroup"
|
||||||
)
|
)
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/sour-is/ev/pkg/math"
|
"go.sour.is/ev/pkg/math"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Set[T comparable] map[T]struct{}
|
type Set[T comparable] map[T]struct{}
|
||||||
|
@ -36,7 +36,7 @@ func (s Set[T]) Delete(items ...T) Set[T] {
|
||||||
|
|
||||||
func (s Set[T]) Equal(e Set[T]) bool {
|
func (s Set[T]) Equal(e Set[T]) bool {
|
||||||
for k := range s {
|
for k := range s {
|
||||||
if _, ok := e[k]; !ok{
|
if _, ok := e[k]; !ok {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/matryer/is"
|
"github.com/matryer/is"
|
||||||
"github.com/sour-is/ev/pkg/set"
|
"go.sour.is/ev/pkg/set"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestStringSet(t *testing.T) {
|
func TestStringSet(t *testing.T) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package slice
|
package slice
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/sour-is/ev/pkg/math"
|
"go.sour.is/ev/pkg/math"
|
||||||
)
|
)
|
||||||
|
|
||||||
// FilterType returns a subset that matches the type.
|
// FilterType returns a subset that matches the type.
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/matryer/is"
|
"github.com/matryer/is"
|
||||||
"github.com/sour-is/ev/pkg/slice"
|
"go.sour.is/ev/pkg/slice"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestAlign(t *testing.T) {
|
func TestAlign(t *testing.T) {
|
||||||
|
@ -27,8 +27,8 @@ func TestAlign(t *testing.T) {
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
left: []string{"2", "3", "4"},
|
left: []string{"2", "3", "4"},
|
||||||
right: []string{"1", "3", "5"},
|
right: []string{"1", "3", "5"},
|
||||||
combined: []slice.Pair[*string, *string]{
|
combined: []slice.Pair[*string, *string]{
|
||||||
{nil, ptr("1")},
|
{nil, ptr("1")},
|
||||||
{ptr("2"), nil},
|
{ptr("2"), nil},
|
||||||
|
@ -37,7 +37,6 @@ func TestAlign(t *testing.T) {
|
||||||
{nil, ptr("5")},
|
{nil, ptr("5")},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
is := is.New(t)
|
is := is.New(t)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user