Versions in this module Expand all Collapse all v0 v0.0.4 Jan 6, 2024 v0.0.3 Jan 6, 2024 v0.0.2 Jan 6, 2024 v0.0.1 Jan 5, 2024 Changes in this version + var ErrUserAlreadySet = errors.New("user set in sigchain already") + func NewSigchainStatement(sc *keys.Sigchain, user *User, sk *keys.EdX25519Key, ts time.Time) (*keys.Statement, error) + func SetLogger(l Logger) + type ContextLogger interface + Debugf func(ctx context.Context, format string, args ...interface{}) + Errorf func(ctx context.Context, format string, args ...interface{}) + Infof func(ctx context.Context, format string, args ...interface{}) + Warningf func(ctx context.Context, format string, args ...interface{}) + func NewContextLogger(lev LogLevel) ContextLogger + type LogLevel int + const DebugLevel + const ErrLevel + const InfoLevel + const WarnLevel + func (l LogLevel) String() string + type Logger interface + Debugf func(format string, args ...interface{}) + Errorf func(format string, args ...interface{}) + Fatalf func(format string, args ...interface{}) + Infof func(format string, args ...interface{}) + Warningf func(format string, args ...interface{}) + func NewLogger(lev LogLevel) Logger + type Result struct + Err string + Proxied bool + Statement string + Status Status + Timestamp int64 + User *User + VerifiedAt int64 + func (r Result) IsTimestampExpired(now time.Time, dt time.Duration) bool + func (r Result) IsVerifyExpired(now time.Time, dt time.Duration) bool + func (r Result) String() string + type Status string + const StatusConnFailure + const StatusContentInvalid + const StatusContentNotFound + const StatusFailure + const StatusOK + const StatusResourceNotFound + const StatusStatementInvalid + const StatusUnknown + func FindVerify(usr *User, b []byte, isHTML bool) (Status, string, error) + type User struct + KID keys.ID + Name string + Seq int + Service string + URL string + func FindInSigchain(sc *keys.Sigchain) (*User, error) + func New(kid keys.ID, service string, name string, urs string, seq int) (*User, error) + func NewEcho(sk *keys.EdX25519Key, name string, seq int) (*User, error) + func NewForSigning(kid keys.ID, service string, name string) (*User, error) + func (u *User) Sign(key *keys.EdX25519Key) (string, error) + func (u *User) UnmarshalJSON(b []byte) error + func (u *User) Validate() error + func (u *User) Verify(msg string) error + func (u User) Bytes() ([]byte, error) + func (u User) ID() string + func (u User) MarshalJSON() ([]byte, error) + func (u User) String() string