Add documentation, remove unused files

This commit is contained in:
lash
2024-11-03 19:04:44 +00:00
parent 4491f0155f
commit e420231f10
11 changed files with 89 additions and 83 deletions

View File

@@ -12,12 +12,19 @@ var (
logg = logging.NewVanilla().WithDomain("term-lookup")
)
// Identity contains all flavors of identifiers used across stream, api and
// client for a single agent.
type Identity struct {
NormalAddress string
ChecksumAddress string
SessionId string
}
// IdentityFromAddress fully populates and Identity object from a given
// checksum address.
//
// It is the caller's responsibility to ensure that a valid checksum address
// is passed.
func IdentityFromAddress(ctx context.Context, store *common.UserDataStore, address string) (Identity, error) {
var err error
var ident Identity
@@ -34,6 +41,7 @@ func IdentityFromAddress(ctx context.Context, store *common.UserDataStore, addre
return ident, nil
}
// load matching session from address from db store.
func getSessionIdByAddress(ctx context.Context, store *common.UserDataStore, address string) (string, error) {
// TODO: replace with userdatastore when double sessionid issue fixed
//r, err := store.ReadEntry(ctx, address, common.DATA_PUBLIC_KEY_REVERSE)

View File

@@ -5,5 +5,6 @@ import (
)
var (
// Api provides the api implementation for all external lookups.
Api remote.AccountServiceInterface = &remote.AccountService{}
)