Documentation ¶
Index ¶
- Constants
- func FindKeyInJson(json any, path []any, key string) [][]any
- func Handler(maxSize int64, ...) func(w http.ResponseWriter, r *http.Request)
- func RequestHandler(r *http.Request, ...) (int, any, error)
- func Run(port int, tp trace.TracerProvider, db *sql.DB)
- func SetupHTTPServer(responder Responder, tp trace.TracerProvider) *http.ServeMux
- type Action
- type Client
- func (c *Client) CreateMessage(ctx context.Context, request *CreateMessageRequest) (*CreateMessageResponse, error)
- func (c *Client) CreateUser(ctx context.Context, request *CreateUserRequest) (*CreateUserResponse, error)
- func (c *Client) FollowUser(ctx context.Context, request *FollowRequest) (*FollowResponse, error)
- func (c *Client) GetFollowers(ctx context.Context, request *GetFollowersOfUserRequest) (*GetFollowersOfUserResponse, error)
- func (c *Client) GetMessage(ctx context.Context, request *GetMessageRequest) (*GetMessageResponse, error)
- func (c *Client) GetMessages(ctx context.Context, request *GetMessagesRequest) (*GetMessagesResponse, error)
- func (c *Client) GetUser(ctx context.Context, request *GetUserRequest) (*GetUserResponse, error)
- func (c *Client) GetUserMessages(ctx context.Context, request *GetUserMessagesRequest) (*GetUserMessagesResponse, error)
- func (c *Client) GetUserTimeline(ctx context.Context, request *GetUserTimelineRequest) (*GetUserTimelineResponse, error)
- func (c *Client) GetUsers(ctx context.Context, request *GetUsersRequest) (*GetUsersResponse, error)
- func (c *Client) SearchMessages(ctx context.Context, request *SearchMessagesRequest) (*SearchMessagesResponse, error)
- func (c *Client) SearchUsers(ctx context.Context, request *SearchUsersRequest) (*SearchUsersResponse, error)
- func (c *Client) UpvoteMessage(ctx context.Context, request *CreateUpvoteRequest) (*CreateUpvoteResponse, error)
- type CreateMessageRequest
- type CreateMessageResponse
- type CreateUpvoteRequest
- type CreateUpvoteResponse
- type CreateUserRequest
- type CreateUserResponse
- type FollowRequest
- type FollowResponse
- type GetFollowersOfUserRequest
- type GetFollowersOfUserResponse
- type GetMessageRequest
- type GetMessageResponse
- type GetMessagesRequest
- type GetMessagesResponse
- type GetUserMessagesRequest
- type GetUserMessagesResponse
- type GetUserRequest
- type GetUserResponse
- type GetUserTimelineRequest
- type GetUserTimelineResponse
- type GetUsersRequest
- type GetUsersResponse
- type Model
- func (m *Model) CreateMessage(ctx context.Context, req *CreateMessageRequest) (*CreateMessageResponse, error)
- func (m *Model) CreateUpvote(ctx context.Context, req *CreateUpvoteRequest) (*CreateUpvoteResponse, error)
- func (m *Model) CreateUser(ctx context.Context, req *CreateUserRequest) (*CreateUserResponse, error)
- func (m *Model) Dump(ctx context.Context) (string, error)
- func (m *Model) Follow(ctx context.Context, req *FollowRequest) (*FollowResponse, error)
- func (m *Model) GetFollowers(ctx context.Context, req *GetFollowersOfUserRequest) (*GetFollowersOfUserResponse, error)
- func (m *Model) GetMessage(ctx context.Context, req *GetMessageRequest) (*GetMessageResponse, error)
- func (m *Model) GetMessages(ctx context.Context, req *GetMessagesRequest) (*GetMessagesResponse, error)
- func (m *Model) GetUser(ctx context.Context, req *GetUserRequest) (*GetUserResponse, error)
- func (m *Model) GetUserMessages(ctx context.Context, req *GetUserMessagesRequest) (*GetUserMessagesResponse, error)
- func (m *Model) GetUserTimeline(ctx context.Context, req *GetUserTimelineRequest) (*GetUserTimelineResponse, error)
- func (m *Model) GetUsers(ctx context.Context, req *GetUsersRequest) (*GetUsersResponse, error)
- func (m *Model) IsLive(ctx context.Context) bool
- func (m *Model) IsReady(ctx context.Context) bool
- func (m *Model) SearchMessages(ctx context.Context, req *SearchMessagesRequest) (*SearchMessagesResponse, error)
- func (m *Model) SearchUsers(ctx context.Context, req *SearchUsersRequest) (*SearchUsersResponse, error)
- func (m *Model) Sleep(ctx context.Context, milliseconds string) error
- type Responder
- type SearchMessagesRequest
- type SearchMessagesResponse
- type SearchUsersRequest
- type SearchUsersResponse
Constants ¶
View Source
const ( // kubernetes LivenessPath = "/liveness" ReadinessPath = "/readiness" // core model UserPath = "/user" UserTimelinePath = "/user/timeline" UserMessagesPath = "/user/messages" UsersPath = "/users" MessagePath = "/message" MessagesPath = "/messages" FollowPath = "/follow" FollowersPath = "/followers" UpvotePath = "/upvote" // hacks DumpPath = "/dump" SleepPath = "/sleep" )
Variables ¶
This section is empty.
Functions ¶
func RequestHandler ¶
func SetupHTTPServer ¶
func SetupHTTPServer(responder Responder, tp trace.TracerProvider) *http.ServeMux
Types ¶
type Client ¶
type Client struct { URL string Resty *resty.Client }
func (*Client) CreateMessage ¶
func (c *Client) CreateMessage(ctx context.Context, request *CreateMessageRequest) (*CreateMessageResponse, error)
func (*Client) CreateUser ¶
func (c *Client) CreateUser(ctx context.Context, request *CreateUserRequest) (*CreateUserResponse, error)
func (*Client) FollowUser ¶
func (c *Client) FollowUser(ctx context.Context, request *FollowRequest) (*FollowResponse, error)
func (*Client) GetFollowers ¶
func (c *Client) GetFollowers(ctx context.Context, request *GetFollowersOfUserRequest) (*GetFollowersOfUserResponse, error)
func (*Client) GetMessage ¶
func (c *Client) GetMessage(ctx context.Context, request *GetMessageRequest) (*GetMessageResponse, error)
func (*Client) GetMessages ¶
func (c *Client) GetMessages(ctx context.Context, request *GetMessagesRequest) (*GetMessagesResponse, error)
func (*Client) GetUser ¶
func (c *Client) GetUser(ctx context.Context, request *GetUserRequest) (*GetUserResponse, error)
func (*Client) GetUserMessages ¶
func (c *Client) GetUserMessages(ctx context.Context, request *GetUserMessagesRequest) (*GetUserMessagesResponse, error)
func (*Client) GetUserTimeline ¶
func (c *Client) GetUserTimeline(ctx context.Context, request *GetUserTimelineRequest) (*GetUserTimelineResponse, error)
func (*Client) GetUsers ¶
func (c *Client) GetUsers(ctx context.Context, request *GetUsersRequest) (*GetUsersResponse, error)
func (*Client) SearchMessages ¶
func (c *Client) SearchMessages(ctx context.Context, request *SearchMessagesRequest) (*SearchMessagesResponse, error)
func (*Client) SearchUsers ¶
func (c *Client) SearchUsers(ctx context.Context, request *SearchUsersRequest) (*SearchUsersResponse, error)
func (*Client) UpvoteMessage ¶
func (c *Client) UpvoteMessage(ctx context.Context, request *CreateUpvoteRequest) (*CreateUpvoteResponse, error)
type CreateMessageRequest ¶
type CreateMessageResponse ¶
type CreateMessageResponse struct { MessageId uuid.UUID Request *CreateMessageRequest }
type CreateUpvoteResponse ¶
type CreateUpvoteResponse struct { UpvoteId uuid.UUID Request *CreateUpvoteRequest }
type CreateUserRequest ¶
type CreateUserResponse ¶
type CreateUserResponse struct { UserId uuid.UUID Request *CreateUserRequest }
type FollowRequest ¶
type FollowResponse ¶
type FollowResponse struct {
Request *FollowRequest
}
type GetFollowersOfUserResponse ¶
type GetFollowersOfUserResponse struct { Followers []GetUserResponse Request *GetFollowersOfUserRequest }
type GetMessageRequest ¶
type GetMessageResponse ¶
type GetMessagesRequest ¶
type GetMessagesRequest struct { }
type GetMessagesResponse ¶
type GetMessagesResponse struct { Messages []GetMessageResponse Request *GetMessagesRequest }
type GetUserMessagesRequest ¶
type GetUserMessagesResponse ¶
type GetUserMessagesResponse struct { UserId uuid.UUID Messages []GetMessageResponse Request *GetUserMessagesRequest }
type GetUserRequest ¶
type GetUserTimelineRequest ¶
type GetUserTimelineResponse ¶
type GetUserTimelineResponse struct { UserId uuid.UUID Messages []GetMessageResponse Request *GetUserTimelineRequest }
type GetUsersRequest ¶
type GetUsersRequest struct { }
type GetUsersResponse ¶
type GetUsersResponse struct { Users []GetUserResponse Request *GetUsersRequest }
type Model ¶
func (*Model) CreateMessage ¶
func (m *Model) CreateMessage(ctx context.Context, req *CreateMessageRequest) (*CreateMessageResponse, error)
func (*Model) CreateUpvote ¶
func (m *Model) CreateUpvote(ctx context.Context, req *CreateUpvoteRequest) (*CreateUpvoteResponse, error)
func (*Model) CreateUser ¶
func (m *Model) CreateUser(ctx context.Context, req *CreateUserRequest) (*CreateUserResponse, error)
func (*Model) Follow ¶
func (m *Model) Follow(ctx context.Context, req *FollowRequest) (*FollowResponse, error)
func (*Model) GetFollowers ¶
func (m *Model) GetFollowers(ctx context.Context, req *GetFollowersOfUserRequest) (*GetFollowersOfUserResponse, error)
func (*Model) GetMessage ¶
func (m *Model) GetMessage(ctx context.Context, req *GetMessageRequest) (*GetMessageResponse, error)
func (*Model) GetMessages ¶
func (m *Model) GetMessages(ctx context.Context, req *GetMessagesRequest) (*GetMessagesResponse, error)
func (*Model) GetUser ¶
func (m *Model) GetUser(ctx context.Context, req *GetUserRequest) (*GetUserResponse, error)
func (*Model) GetUserMessages ¶
func (m *Model) GetUserMessages(ctx context.Context, req *GetUserMessagesRequest) (*GetUserMessagesResponse, error)
func (*Model) GetUserTimeline ¶
func (m *Model) GetUserTimeline(ctx context.Context, req *GetUserTimelineRequest) (*GetUserTimelineResponse, error)
func (*Model) GetUsers ¶
func (m *Model) GetUsers(ctx context.Context, req *GetUsersRequest) (*GetUsersResponse, error)
func (*Model) SearchMessages ¶
func (m *Model) SearchMessages(ctx context.Context, req *SearchMessagesRequest) (*SearchMessagesResponse, error)
func (*Model) SearchUsers ¶
func (m *Model) SearchUsers(ctx context.Context, req *SearchUsersRequest) (*SearchUsersResponse, error)
type Responder ¶
type Responder interface { Sleep(ctx context.Context, seconds string) error CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error) GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error) GetUserTimeline(context.Context, *GetUserTimelineRequest) (*GetUserTimelineResponse, error) // TODO paginate GetUserMessages(context.Context, *GetUserMessagesRequest) (*GetUserMessagesResponse, error) // TODO paginate GetUsers(context.Context, *GetUsersRequest) (*GetUsersResponse, error) // TODO paginate SearchUsers(context.Context, *SearchUsersRequest) (*SearchUsersResponse, error) // TODO paginate CreateMessage(context.Context, *CreateMessageRequest) (*CreateMessageResponse, error) GetMessage(context.Context, *GetMessageRequest) (*GetMessageResponse, error) GetMessages(context.Context, *GetMessagesRequest) (*GetMessagesResponse, error) // TODO pagniate SearchMessages(context.Context, *SearchMessagesRequest) (*SearchMessagesResponse, error) // TODO paginate Follow(context.Context, *FollowRequest) (*FollowResponse, error) GetFollowers(context.Context, *GetFollowersOfUserRequest) (*GetFollowersOfUserResponse, error) CreateUpvote(context.Context, *CreateUpvoteRequest) (*CreateUpvoteResponse, error) IsLive(context.Context) bool IsReady(context.Context) bool Dump(ctx context.Context) (string, error) }
type SearchMessagesRequest ¶
type SearchMessagesRequest struct {
LiteralString string
}
type SearchMessagesResponse ¶
type SearchMessagesResponse struct { Messages []GetMessageResponse Request *SearchMessagesRequest }
type SearchUsersRequest ¶
type SearchUsersResponse ¶
type SearchUsersResponse struct { Users []GetUserResponse Request *SearchUsersRequest }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.