Documentation ¶
Index ¶
- func NewRequest(method string, urs string, body io.Reader, tm time.Time, key *keys.EdX25519Key) (*http.Request, error)
- func NewRequestWithContext(ctx context.Context, method string, urs string, body io.Reader, tm time.Time, ...) (*http.Request, error)
- func SetLogger(l Logger)
- type Auth
- type AuthResult
- type ContextLogger
- type CreateInviteResponse
- type CreateMessageResponse
- type Error
- type InviteResponse
- type LogLevel
- type Logger
- type MemCache
- type Message
- type MessagesResponse
- type Metadata
- type Response
- type SigchainResponse
- type User
- type UserResponse
- type UserSearchResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRequest ¶
func NewRequest(method string, urs string, body io.Reader, tm time.Time, key *keys.EdX25519Key) (*http.Request, error)
NewRequest returns new authorized/signed HTTP request.
Types ¶
type Auth ¶
Auth describes auth for a HTTP request.
type AuthResult ¶
AuthResult is the authorized result.
type ContextLogger ¶
type ContextLogger interface { Debugf(ctx context.Context, format string, args ...interface{}) Infof(ctx context.Context, format string, args ...interface{}) Warningf(ctx context.Context, format string, args ...interface{}) Errorf(ctx context.Context, format string, args ...interface{}) }
ContextLogger interface used in this package with request context.
type CreateInviteResponse ¶
type CreateInviteResponse struct {
Code string `json:"code"`
}
CreateInviteResponse ...
type CreateMessageResponse ¶
type CreateMessageResponse struct {
ID string `json:"id"`
}
CreateMessageResponse ...
type Error ¶
type Error struct { Message string `json:"message,omitempty"` Status int `json:"status,omitempty"` }
Error ...
type InviteResponse ¶
InviteResponse ...
type Logger ¶
type Logger interface { Debugf(format string, args ...interface{}) Infof(format string, args ...interface{}) Warningf(format string, args ...interface{}) Errorf(format string, args ...interface{}) }
Logger interface used in this package.
type MemCache ¶
type MemCache interface { // Get returns value at key. Get(ctx context.Context, k string) (string, error) // Put puts a value at key. Set(ctx context.Context, k string, v string) error // Expire key. Expire(ctx context.Context, k string, dt time.Duration) error }
MemCache ...
type MessagesResponse ¶
type MessagesResponse struct { Messages []*Message `json:"messages"` Metadata map[string]Metadata `json:"md,omitempty"` Version string `json:"version"` }
MessagesResponse is the response from messages.
func (MessagesResponse) MetadataFor ¶
func (r MessagesResponse) MetadataFor(msg *Message) Metadata
MetadataFor returns metadata for Message.
type Metadata ¶
type Metadata struct { CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
Metadata ...
type SigchainResponse ¶
type SigchainResponse struct { KID keys.ID `json:"kid"` Metadata map[string]Metadata `json:"md,omitempty"` Statements []*keys.Statement `json:"statements"` }
SigchainResponse is the response format for a Sigchain request.
func (SigchainResponse) MetadataFor ¶
func (r SigchainResponse) MetadataFor(st *keys.Statement) Metadata
MetadataFor returns metadata for Signed.
type User ¶
type User struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` KID keys.ID `json:"kid,omitempty"` Seq int `json:"seq,omitempty"` Service string `json:"service,omitempty"` URL string `json:"url,omitempty"` Status user.Status `json:"status,omitempty"` VerifiedAt int64 `json:"verifiedAt,omitempty"` Timestamp int64 `json:"ts,omitempty"` Err string `json:"err,omitempty"` }
User ...
func UserFromResult ¶
UserFromResult returns User from user.Result.
type UserSearchResponse ¶
type UserSearchResponse struct {
Users []*User `json:"users"`
}
UserSearchResponse ...
Source Files ¶
Click to show internal directories.
Click to hide internal directories.