Documentation ¶
Index ¶
- func MakeCreatePostEndpoint(svc HttpService) endpoint.Endpoint
- func MakeHttpService() *httpService
- func MakeLoginEndpoint(svc HttpService) endpoint.Endpoint
- func MakeViewPostEndpoint(svc HttpService) endpoint.Endpoint
- func MakeVisitPostEndpoint(svc HttpService) endpoint.Endpoint
- type AttachedPost
- type Conditional
- type Engine
- func (e *Engine) AuthorizeUser(username, password string) (user User, err error)
- func (e *Engine) BuildDecider(post Post) func() Link
- func (e *Engine) BuildPopularityDecider(post Post) func() Link
- func (e *Engine) BuildRandomDecider(post Post) func() Link
- func (e *Engine) CreatePost(user User, request proto.CreatePostRequest) (Post, error)
- func (e *Engine) CreateUser(username, password string) (User, error)
- func (e *Engine) DeletePost(key string) (err error)
- func (e *Engine) GetLinks(post *Post) (err error)
- func (e *Engine) GetPost(key string) (post Post, err error)
- func (e *Engine) GetPostLinks(key string) (*Post, error)
- func (e *Engine) GetPostLinksdec(key string) (*Post, error)
- func (e *Engine) InitDB()
- func (e *Engine) InitSchema()
- func (e *Engine) Login(username, password string) (user User, err error)
- func (e *Engine) Register(username, password string) (User, error)
- func (e *Engine) TotalPostVisits(post *Post) (visits uint)
- func (e *Engine) VisitKey(key string) (Link, error)
- func (e *Engine) VisitPost(post *Post) (link Link, err error)
- type HttpService
- type Link
- type Post
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeCreatePostEndpoint ¶
func MakeCreatePostEndpoint(svc HttpService) endpoint.Endpoint
func MakeHttpService ¶
func MakeHttpService() *httpService
func MakeLoginEndpoint ¶
func MakeLoginEndpoint(svc HttpService) endpoint.Endpoint
func MakeViewPostEndpoint ¶
func MakeViewPostEndpoint(svc HttpService) endpoint.Endpoint
func MakeVisitPostEndpoint ¶
func MakeVisitPostEndpoint(svc HttpService) endpoint.Endpoint
Types ¶
type AttachedPost ¶
type Conditional ¶
type Engine ¶
type Engine struct { Dialect string Args string LogMode bool // contains filtered or unexported fields }
func (*Engine) AuthorizeUser ¶
func (*Engine) BuildDecider ¶
func (*Engine) BuildPopularityDecider ¶
func (*Engine) BuildRandomDecider ¶
func (*Engine) CreatePost ¶
func (*Engine) DeletePost ¶
func (*Engine) InitSchema ¶
func (e *Engine) InitSchema()
func (*Engine) TotalPostVisits ¶
type HttpService ¶
type HttpService interface { Login(context.Context, proto.LoginRequest) (proto.LoginResponse, error) Logout(ctx context.Context) (proto.LogoutResponse, error) Register(context.Context, proto.RegisterRequest) (proto.RegisterResponse, error) VisitPost(context.Context, proto.VisitPostRequest) (proto.VisitPostResponse, error) ViewPost(context.Context, proto.ViewPostRequest) (proto.ViewPostResponse, error) CreatePost(context.Context, proto.CreatePostRequest) (proto.CreatePostResponse, error) DeletePost(context.Context, proto.DeletePostRequest) (proto.DeletePostResponse, error) }
Click to show internal directories.
Click to hide internal directories.