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