···
comatproto "github.com/bluesky-social/indigo/api/atproto"
lexutil "github.com/bluesky-social/indigo/lex/util"
"github.com/gliderlabs/ssh"
"github.com/go-chi/chi/v5"
···
func Make() (*State, error) {
···
-
return &State{db, auth, enforcer}, nil
func (s *State) Login(w http.ResponseWriter, r *http.Request) {
···
resp, err := comatproto.RepoPutRecord(r.Context(), client, &comatproto.RepoPutRecord_Input{
Collection: tangled.PublicKeyNSID,
-
Rkey: uuid.New().String(),
Record: &lexutil.LexiconTypeDecoder{
Created: time.Now().Format(time.RFC3339),
···
resp, err := comatproto.RepoPutRecord(r.Context(), client, &comatproto.RepoPutRecord_Input{
Collection: tangled.KnotMemberNSID,
-
Rkey: uuid.New().String(),
Record: &lexutil.LexiconTypeDecoder{
Val: &tangled.KnotMember{
Member: memberIdent.DID.String(),
···
comatproto "github.com/bluesky-social/indigo/api/atproto"
+
"github.com/bluesky-social/indigo/atproto/syntax"
lexutil "github.com/bluesky-social/indigo/lex/util"
"github.com/gliderlabs/ssh"
"github.com/go-chi/chi/v5"
···
+
tidClock *syntax.TIDClock
func Make() (*State, error) {
···
+
clock := syntax.NewTIDClock(0)
+
return &State{db, auth, enforcer, clock}, nil
+
func (s *State) TID() string {
+
return s.tidClock.Next().String()
func (s *State) Login(w http.ResponseWriter, r *http.Request) {
···
resp, err := comatproto.RepoPutRecord(r.Context(), client, &comatproto.RepoPutRecord_Input{
Collection: tangled.PublicKeyNSID,
Record: &lexutil.LexiconTypeDecoder{
Created: time.Now().Format(time.RFC3339),
···
resp, err := comatproto.RepoPutRecord(r.Context(), client, &comatproto.RepoPutRecord_Input{
Collection: tangled.KnotMemberNSID,
Record: &lexutil.LexiconTypeDecoder{
Val: &tangled.KnotMember{
Member: memberIdent.DID.String(),