Documentation ¶
Index ¶
- Variables
- type API
- type AuthenticateRequest
- type AuthenticateResponse
- type ContextKey
- type CreateNoteRequest
- type CreateNoteResponse
- type Follow
- type FollowRequest
- type FollowResponse
- type GetFolloweesRequest
- type GetFolloweesResponse
- type GetFollowersRequest
- type GetFollowersResponse
- type GetNoteRequest
- type GetNoteResponse
- type GetNotesRequest
- type GetNotesResponse
- type GetProfileRequest
- type GetProfileResponse
- type Handlers
- func (handlers *Handlers) HandleFollow(w http.ResponseWriter, r *http.Request)
- func (handlers *Handlers) HandleIndex(w http.ResponseWriter, r *http.Request)
- func (handlers *Handlers) HandleLogin(w http.ResponseWriter, r *http.Request)
- func (handlers *Handlers) HandleLogout(w http.ResponseWriter, r *http.Request)
- func (handlers *Handlers) HandleNotes(w http.ResponseWriter, r *http.Request)
- func (handlers *Handlers) HandleNotesNew(w http.ResponseWriter, r *http.Request)
- func (handlers *Handlers) HandlePopulate(w http.ResponseWriter, r *http.Request)
- func (handlers *Handlers) HandleProfile(w http.ResponseWriter, r *http.Request)
- func (handlers *Handlers) HandleRegister(w http.ResponseWriter, r *http.Request)
- func (handlers *Handlers) Register(r *chi.Mux)
- type NimonaFeed
- type NimonaFollow
- type NimonaNote
- type NimonaProfile
- type Note
- type Profile
- type RegisterRequest
- type RegisterResponse
- type SQLStore
- func (s *SQLStore) GetFollowees(ctx context.Context, follower nimona.KeygraphID) ([]*Follow, error)
- func (s *SQLStore) GetFollowers(ctx context.Context, followee nimona.KeygraphID) ([]*Follow, error)
- func (s *SQLStore) GetNotes(ctx context.Context, identityNRI string, offset int, limit int) ([]*Note, error)
- func (s *SQLStore) GetProfile(ctx context.Context, keygraphID nimona.KeygraphID) (*Profile, error)
- func (s *SQLStore) GetSession(ctx context.Context, id string) (*Session, error)
- func (s *SQLStore) GetUser(ctx context.Context, username string) (*User, error)
- func (s *SQLStore) PutFollow(ctx context.Context, req *Follow) error
- func (s *SQLStore) PutNote(ctx context.Context, req *Note) error
- func (s *SQLStore) PutProfile(ctx context.Context, req *Profile) error
- func (s *SQLStore) PutSession(ctx context.Context, req *Session) error
- func (s *SQLStore) PutUser(ctx context.Context, req *User) error
- type Session
- type Store
- type TemplateValues
- type UpdateProfileRequest
- type UpdateProfileResponse
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = fmt.Errorf("not found")
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface { Register(context.Context, *RegisterRequest) (*RegisterResponse, error) Login(context.Context, *AuthenticateRequest) (*AuthenticateResponse, error) GetProfile(context.Context, *GetProfileRequest) (*GetProfileResponse, error) UpdateProfile(context.Context, *UpdateProfileRequest) (*UpdateProfileResponse, error) CreateNote(context.Context, *CreateNoteRequest) (*CreateNoteResponse, error) GetNotes(context.Context, *GetNotesRequest) (*GetNotesResponse, error) GetNote(context.Context, *GetNoteRequest) (*GetNoteResponse, error) Follow(context.Context, *FollowRequest) (*FollowResponse, error) GetFollowees(context.Context, *GetFolloweesRequest) (*GetFolloweesResponse, error) GetFollowers(context.Context, *GetFollowersRequest) (*GetFollowersResponse, error) }
type AuthenticateRequest ¶
type AuthenticateResponse ¶
type ContextKey ¶
type ContextKey int
const ( KeyUsername ContextKey = iota KeyIsAuthenticated ContextKey = iota )
type CreateNoteRequest ¶
type CreateNoteResponse ¶
type CreateNoteResponse struct{}
type FollowRequest ¶
type FollowRequest struct { // TODO: should this be a username? KeygraphID nimona.KeygraphID `json:"keygraph"` FolloweeIdentity nimona.KeygraphID `json:"followeeIdentity"` }
type FollowResponse ¶
type FollowResponse struct{}
type GetFolloweesRequest ¶
type GetFolloweesRequest struct {
KeygraphID nimona.KeygraphID `json:"keygraph"`
}
type GetFolloweesResponse ¶
type GetFolloweesResponse struct {
Followees []nimona.KeygraphID `json:"followees"`
}
type GetFollowersRequest ¶
type GetFollowersRequest struct {
KeygraphID nimona.KeygraphID `json:"keygraph"`
}
type GetFollowersResponse ¶
type GetFollowersResponse struct {
Followers []nimona.KeygraphID `json:"followers"`
}
type GetNoteRequest ¶
type GetNoteRequest struct {
NoteID string `json:"noteId"`
}
type GetNoteResponse ¶
type GetNoteResponse struct {
Note *Note `json:"note"`
}
type GetNotesRequest ¶
type GetNotesResponse ¶
type GetNotesResponse struct {
Notes []*Note `json:"notes"`
}
type GetProfileRequest ¶
type GetProfileRequest struct {
KeygraphID nimona.KeygraphID `json:"keygraph"`
}
type GetProfileResponse ¶
type GetProfileResponse struct { KeygraphID nimona.KeygraphID `json:"keygraph"` Profile Profile `json:"profile"` }
type Handlers ¶
type Handlers struct {
// contains filtered or unexported fields
}
func (*Handlers) HandleFollow ¶
func (handlers *Handlers) HandleFollow(w http.ResponseWriter, r *http.Request)
func (*Handlers) HandleIndex ¶
func (handlers *Handlers) HandleIndex( w http.ResponseWriter, r *http.Request, )
func (*Handlers) HandleLogin ¶
func (handlers *Handlers) HandleLogin(w http.ResponseWriter, r *http.Request)
func (*Handlers) HandleLogout ¶
func (handlers *Handlers) HandleLogout(w http.ResponseWriter, r *http.Request)
func (*Handlers) HandleNotes ¶
func (handlers *Handlers) HandleNotes( w http.ResponseWriter, r *http.Request, )
func (*Handlers) HandleNotesNew ¶
func (handlers *Handlers) HandleNotesNew( w http.ResponseWriter, r *http.Request, )
func (*Handlers) HandlePopulate ¶
func (handlers *Handlers) HandlePopulate( w http.ResponseWriter, r *http.Request, )
func (*Handlers) HandleProfile ¶
func (handlers *Handlers) HandleProfile(w http.ResponseWriter, r *http.Request)
func (*Handlers) HandleRegister ¶
func (handlers *Handlers) HandleRegister( w http.ResponseWriter, r *http.Request, )
type NimonaFeed ¶
type NimonaFeed struct { Metadata nimona.Metadata `nimona:"$metadata,type=feed"` Profile NimonaProfile `nimona:"profile,omitempty"` Notes []*NimonaNote `nimona:"notes,omitempty"` Folowees []*NimonaFollow `nimona:"folowees,omitempty"` }
func (*NimonaFeed) Document ¶
func (t *NimonaFeed) Document() *nimona.Document
func (*NimonaFeed) FromDocument ¶
func (t *NimonaFeed) FromDocument(d *nimona.Document) error
func (*NimonaFeed) Map ¶
func (t *NimonaFeed) Map() tilde.Map
type NimonaFollow ¶
type NimonaFollow struct { Metadata nimona.Metadata `nimona:"$metadata,type=follow"` KeygraphID nimona.KeygraphID `nimona:"identity,omitempty"` Alias nimona.IdentityAlias `nimona:"alias,omitempty"` Timestamp string `nimona:"timestamp,omitempty"` }
func (*NimonaFollow) Document ¶
func (t *NimonaFollow) Document() *nimona.Document
func (*NimonaFollow) FromDocument ¶
func (t *NimonaFollow) FromDocument(d *nimona.Document) error
func (*NimonaFollow) Map ¶
func (t *NimonaFollow) Map() tilde.Map
type NimonaNote ¶
type NimonaNote struct { Metadata nimona.Metadata `nimona:"$metadata,type=note"` Key string `nimona:"_key,omitempty"` Partition string `nimona:"_partition,omitempty"` Content string `nimona:"content"` }
func (*NimonaNote) Document ¶
func (t *NimonaNote) Document() *nimona.Document
func (*NimonaNote) FromDocument ¶
func (t *NimonaNote) FromDocument(d *nimona.Document) error
func (*NimonaNote) Map ¶
func (t *NimonaNote) Map() tilde.Map
type NimonaProfile ¶
type NimonaProfile struct { Metadata nimona.Metadata `nimona:"$metadata,type=profile"` DisplayName string `nimona:"displayName,omitempty"` Description string `nimona:"description,omitempty"` Alias *nimona.IdentityAlias `nimona:"alias,omitempty"` AvatarURL string `nimona:"avatarURL,omitempty"` }
func (*NimonaProfile) Document ¶
func (t *NimonaProfile) Document() *nimona.Document
func (*NimonaProfile) FromDocument ¶
func (t *NimonaProfile) FromDocument(d *nimona.Document) error
func (*NimonaProfile) Map ¶
func (t *NimonaProfile) Map() tilde.Map
type RegisterRequest ¶
type RegisterResponse ¶
type SQLStore ¶
type SQLStore struct {
// contains filtered or unexported fields
}
func (*SQLStore) GetFollowees ¶
func (*SQLStore) GetFollowers ¶
func (*SQLStore) GetProfile ¶
func (*SQLStore) GetSession ¶
func (*SQLStore) PutProfile ¶
func (*SQLStore) PutSession ¶
type Store ¶
type Store interface { PutUser(context.Context, *User) error GetUser(context.Context, string) (*User, error) PutProfile(context.Context, *Profile) error GetProfile(context.Context, nimona.KeygraphID) (*Profile, error) PutNote(context.Context, *Note) error GetNotes(context.Context, string, int, int) ([]*Note, error) PutFollow(context.Context, *Follow) error GetFollowers(context.Context, nimona.KeygraphID) ([]*Follow, error) GetFollowees(context.Context, nimona.KeygraphID) ([]*Follow, error) PutSession(context.Context, *Session) error GetSession(context.Context, string) (*Session, error) }
func NewSQLStore ¶
type TemplateValues ¶
type UpdateProfileRequest ¶
type UpdateProfileResponse ¶
type UpdateProfileResponse struct{}
Click to show internal directories.
Click to hide internal directories.