Documentation ¶
Index ¶
- Constants
- type Endpoints
- func (e Endpoints) CreateOrganization(db *gorm.DB, userId string, name string) (*domain.Organization, error)
- func (e Endpoints) CreateOrganizationJoinLink(db *gorm.DB, userId string, organizationId string, ttl int64) (*domain.OrganizationJoinLink, error)
- func (e Endpoints) CreateSnippet(snipp *types.Problem, index string, userId string) error
- func (e Endpoints) DeleteOrganizationJoinLink(db *gorm.DB, userId string, organizationJoinLinkId string) error
- func (e Endpoints) ExpelUserFromOrganization(db *gorm.DB, userId string, userIdToExpel string, organizationId string) error
- func (e *Endpoints) GetLatestSnippets(index string) ([]types.Problem, error)
- func (e Endpoints) GetOrganizationJoinLink(db *gorm.DB, organizationJoinLinkId string) (domain.OrganizationJoinLink, error)
- func (e Endpoints) GetOrganizationJoinLinkForOrganization(db *gorm.DB, userId string, organizationId string) (*domain.OrganizationJoinLink, error)
- func (e Endpoints) GetSnippet(index string, id string) (*types.Problem, error)
- func (e *Endpoints) GetUser(token string) (*domain.User, error)
- func (e *Endpoints) GithubAuth(code string) (*domain.User, *domain.AccessToken, error)
- func (e Endpoints) GrantAdminRightToUser(db *gorm.DB, userId string, userIdToAdmin string, organizationId string) error
- func (e Endpoints) JoinOrganization(db *gorm.DB, userId string, organizationJoinLinkId string) error
- func (e Endpoints) LeaveOrganization(db *gorm.DB, userId string, organizationId string) error
- func (e Endpoints) ListUserOrganizations(db *gorm.DB, userId string) ([]domain.Organization, error)
- func (e *Endpoints) Query(q string, size int, private bool) ([]types.Problem, error)
- func (e Endpoints) Slack(text string) (string, error)
- func (e Endpoints) UpdateSnippet(snipp *types.Problem, index string, userId string) error
- func (e Endpoints) Worked(id, query string) error
- type SlackAttachments
- type SlackMessage
Constants ¶
View Source
const (
PublicBorgSnippet = "borg"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Endpoints ¶
type Endpoints struct {
// contains filtered or unexported fields
}
Endpoints represents all endpoints of the http server
func NewEndpoints ¶
func NewEndpoints( oauthCfg *oauth2.Config, client *elastic.Client, a *ga.Client, db *gorm.DB, ) *Endpoints
NewEndpoints is just below the http handlers
func (Endpoints) CreateOrganization ¶
func (Endpoints) CreateOrganizationJoinLink ¶
func (Endpoints) CreateSnippet ¶
CreateSnippet saves a snippet, generates id
func (Endpoints) DeleteOrganizationJoinLink ¶
func (Endpoints) ExpelUserFromOrganization ¶
func (*Endpoints) GetLatestSnippets ¶
GetLatestSnippets in reverse chronological order
func (Endpoints) GetOrganizationJoinLink ¶
func (Endpoints) GetOrganizationJoinLinkForOrganization ¶
func (Endpoints) GetSnippet ¶
GetSnippet by id
func (*Endpoints) GithubAuth ¶
GithubAuth exchanges a github code for a token, registers and returns a User
func (Endpoints) GrantAdminRightToUser ¶
func (Endpoints) JoinOrganization ¶
func (Endpoints) LeaveOrganization ¶
func (Endpoints) ListUserOrganizations ¶
func (Endpoints) UpdateSnippet ¶
UpdateSnippet saves a snippet
type SlackAttachments ¶
type SlackMessage ¶
type SlackMessage struct { Text string `json:"text"` Mrkdwn bool `json:"mrkdwn"` Attachments []SlackAttachments `json:"attachments"` }
TODO: Should I leave the structs here or move them to types package ?
Click to show internal directories.
Click to hide internal directories.