diff --git a/api/bild/cbor_gen.go b/api/tangled/cbor_gen.go similarity index 95% rename from api/bild/cbor_gen.go rename to api/tangled/cbor_gen.go index 594dea0..b71843e 100644 --- a/api/bild/cbor_gen.go +++ b/api/tangled/cbor_gen.go @@ -1,6 +1,6 @@ // Code generated by github.com/whyrusleeping/cbor-gen. DO NOT EDIT. -package bild +package tangled import ( "fmt" @@ -88,10 +88,10 @@ func (t *PublicKey) MarshalCBOR(w io.Writer) error { return err } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.bild.publicKey"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.publicKey"))); err != nil { return err } - if _, err := cw.WriteString(string("sh.bild.publicKey")); err != nil { + if _, err := cw.WriteString(string("sh.tangled.publicKey")); err != nil { return err } diff --git a/api/bild/bildpublicKey.go b/api/tangled/tangledpublicKey.go similarity index 62% rename from api/bild/bildpublicKey.go rename to api/tangled/tangledpublicKey.go index 3cd567f..be14d22 100644 --- a/api/bild/bildpublicKey.go +++ b/api/tangled/tangledpublicKey.go @@ -1,19 +1,23 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package bild +package tangled -// schema: sh.bild.publicKey +// schema: sh.tangled.publicKey import ( "github.com/bluesky-social/indigo/lex/util" ) +const ( + PublicKeyNSID = "sh.tangled.publicKey" +) + func init() { - util.RegisterType("sh.bild.publicKey", &PublicKey{}) + util.RegisterType("sh.tangled.publicKey", &PublicKey{}) } // // RECORDTYPE: PublicKey type PublicKey struct { - LexiconTypeID string `json:"$type,const=sh.bild.publicKey" cborgen:"$type,const=sh.bild.publicKey"` + LexiconTypeID string `json:"$type,const=sh.tangled.publicKey" cborgen:"$type,const=sh.tangled.publicKey"` // created: key upload timestamp Created string `json:"created" cborgen:"created"` // key: public key contents diff --git a/appview/state/state.go b/appview/state/state.go index a2b7cc4..38d8df5 100644 --- a/appview/state/state.go +++ b/appview/state/state.go @@ -14,7 +14,7 @@ import ( "github.com/gliderlabs/ssh" "github.com/go-chi/chi/v5" "github.com/google/uuid" - shbild "github.com/icyphox/bild/api/bild" + tangled "github.com/icyphox/bild/api/tangled" "github.com/icyphox/bild/appview" "github.com/icyphox/bild/appview/auth" "github.com/icyphox/bild/appview/db" @@ -148,7 +148,7 @@ func (s *State) Keys(w http.ResponseWriter, r *http.Request) { Collection: "sh.bild.publicKey", Repo: did, Rkey: uuid.New().String(), - Record: &lexutil.LexiconTypeDecoder{Val: &shbild.PublicKey{ + Record: &lexutil.LexiconTypeDecoder{Val: &tangled.PublicKey{ Created: time.Now().String(), Key: key, Name: name, diff --git a/cmd/gen.go b/cmd/gen.go index dea851c..53acda3 100644 --- a/cmd/gen.go +++ b/cmd/gen.go @@ -1,7 +1,7 @@ package main import ( - shbild "github.com/icyphox/bild/api/bild" + shtangled "github.com/icyphox/bild/api/tangled" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -12,9 +12,9 @@ func main() { } if err := genCfg.WriteMapEncodersToFile( - "api/bild/cbor_gen.go", - "bild", - shbild.PublicKey{}, + "api/tangled/cbor_gen.go", + "tangled", + shtangled.PublicKey{}, ); err != nil { panic(err) } diff --git a/flake.nix b/flake.nix index 52e5535..611f730 100644 --- a/flake.nix +++ b/flake.nix @@ -50,6 +50,7 @@ pkgs.httpie pkgs.indigo-lexgen pkgs.litecli + pkgs.websocat ]; }; }); diff --git a/knotserver/handler.go b/knotserver/handler.go index d3df8b3..b7b74de 100644 --- a/knotserver/handler.go +++ b/knotserver/handler.go @@ -8,6 +8,7 @@ import ( "net/http" "github.com/go-chi/chi/v5" + tangled "github.com/icyphox/bild/api/tangled" "github.com/icyphox/bild/knotserver/config" "github.com/icyphox/bild/knotserver/db" "github.com/icyphox/bild/knotserver/jsclient" @@ -71,7 +72,7 @@ func Setup(ctx context.Context, c *config.Config, db *db.DB) (http.Handler, erro } func (h *Handle) StartJetstream(ctx context.Context) error { - colections := []string{"sh.bild.publicKeys"} + colections := []string{tangled.PublicKeyNSID} dids := []string{} h.js = jsclient.NewJetstreamClient(colections, dids) diff --git a/lexicon-build-config.json b/lexicon-build-config.json index 4916867..1274bfd 100644 --- a/lexicon-build-config.json +++ b/lexicon-build-config.json @@ -1,9 +1,9 @@ [ { - "package": "bild", - "prefix": "sh.bild", - "outdir": "api/bild", - "import": "github.com/icyphox/bild/api/bild", + "package": "tangled", + "prefix": "sh.tangled", + "outdir": "api/tangled", + "import": "github.com/icyphox/bild/api/tangled", "gen-server": true } ] diff --git a/lexicons/publicKey.json b/lexicons/publicKey.json index d6d2663..51250b4 100644 --- a/lexicons/publicKey.json +++ b/lexicons/publicKey.json @@ -1,6 +1,6 @@ { "lexicon": 1, - "id": "sh.bild.publicKey", + "id": "sh.tangled.publicKey", "needsCbor": true, "needsType": true, "defs": {