handler

package
v0.0.0-...-2b115c7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(logger *slog.Logger, cfg awesomemy.Config, db *sql.DB) http.Handler

func NewAuth

func NewAuth(logger *slog.Logger, cfg awesomemy.Config, db *sql.DB, sm *scs.SessionManager) http.Handler

func NewClient

func NewClient(logger *slog.Logger, cfg awesomemy.Config, db *sql.DB, sm *scs.SessionManager) http.Handler

func NewPublic

func NewPublic(logger *slog.Logger, cfg awesomemy.Config, db *sql.DB) http.Handler

Types

type Auth

type Auth struct {
	// contains filtered or unexported fields
}

func (*Auth) Logout

func (a *Auth) Logout(w http.ResponseWriter, r *http.Request)

func (*Auth) OAuth2

func (a *Auth) OAuth2(w http.ResponseWriter, r *http.Request)

func (*Auth) OAuth2Callback

func (a *Auth) OAuth2Callback(w http.ResponseWriter, r *http.Request)

type Client

type Client struct {
	// contains filtered or unexported fields
}

func (*Client) Account

func (c *Client) Account(w http.ResponseWriter, r *http.Request)

func (*Client) AuthenticateUser

func (c *Client) AuthenticateUser(next http.Handler) http.Handler

func (*Client) DeleteEvent

func (c *Client) DeleteEvent(w http.ResponseWriter, r *http.Request)

func (*Client) DeleteProject

func (c *Client) DeleteProject(w http.ResponseWriter, r *http.Request)

func (*Client) Event

func (c *Client) Event(w http.ResponseWriter, r *http.Request)

func (*Client) Events

func (c *Client) Events(w http.ResponseWriter, r *http.Request)

func (*Client) Project

func (c *Client) Project(w http.ResponseWriter, r *http.Request)

func (*Client) Projects

func (c *Client) Projects(w http.ResponseWriter, r *http.Request)

func (*Client) StoreEvent

func (c *Client) StoreEvent(w http.ResponseWriter, r *http.Request)

func (*Client) StoreProject

func (c *Client) StoreProject(w http.ResponseWriter, r *http.Request)

func (*Client) UpdateEvent

func (c *Client) UpdateEvent(w http.ResponseWriter, r *http.Request)

func (*Client) UpdateProject

func (c *Client) UpdateProject(w http.ResponseWriter, r *http.Request)

type Event

type Event struct {
	Uuid        uuid.UUID    `json:"uuid"`
	Name        string       `json:"name"`
	Description string       `json:"description"`
	Tags        []string     `json:"tags"`
	Website     nulls.String `json:"website"`
	StartsAt    time.Time    `json:"starts_at"`
	EndsAt      time.Time    `json:"ends_at"`
	CreatedAt   time.Time    `json:"created_at"`
}

func EventFromDatabase

func EventFromDatabase(e database.Event) Event

type Project

type Project struct {
	Uuid        uuid.UUID    `json:"uuid"`
	Name        string       `json:"name"`
	Description string       `json:"description"`
	Tags        []string     `json:"tags"`
	Repository  nulls.String `json:"repository"`
	Website     nulls.String `json:"website"`
	CreatedAt   time.Time    `json:"created_at"`
}

func ProjectFromDatabase

func ProjectFromDatabase(p database.Project) Project

type Public

type Public struct {
	// contains filtered or unexported fields
}

func (*Public) Event

func (p *Public) Event(w http.ResponseWriter, r *http.Request)

func (*Public) Events

func (p *Public) Events(w http.ResponseWriter, r *http.Request)

func (*Public) Project

func (p *Public) Project(w http.ResponseWriter, r *http.Request)

func (*Public) Projects

func (p *Public) Projects(w http.ResponseWriter, r *http.Request)

type User

type User struct {
	Uuid        uuid.UUID `json:"uuid"`
	GitHubEmail string    `json:"github_email"`
	CreatedAt   time.Time `json:"created_at"`
}

func UserFromDatabase

func UserFromDatabase(u database.User) User

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL