api

package
v0.0.0-...-bd02bc2 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2022 License: Unlicense Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AuthSecret = ""

AuthSecret is the secret used when generating mini auth tokens

View Source
var DB *db.DB
View Source
var JWTSecret string

JWTSecret is the Secret used when signing JTW tokens

View Source
var ListenOn = ":8866"
View Source
var Logger *zap.Logger
View Source
var Router = mux.NewRouter()

Functions

func GenerateValidAuthTokens

func GenerateValidAuthTokens(forWhat string) []string

GenerateValidAuthTokens generates all possible valid auth tokens for right now. To me used both when vreating new tokens and validating incoming tokens

func NotImplemented

func NotImplemented(w http.ResponseWriter, e *http.Request)

func Run

func Run()

Types

type Event

type Event struct {
	ID      uint
	When    *time.Time
	Where   string
	Title   string
	Members []*db.EventMember
	Need    int
}

type EventCreateRequestBody

type EventCreateRequestBody struct {
	Title       string
	Description string
	When        string
	Where       string
	Need        int
}

type EventJoinRequestBody

type EventJoinRequestBody struct {
	Type int `json:"type"`
}

type EventLeaveRequestBody

type EventLeaveRequestBody struct {
	// Member is the id of the event_member (EventMember.ID), not the member id (Member.ID). One member can fill multiple slots in an event.
	Member uint `json:"member"`
}

type EventsResponse

type EventsResponse struct {
	Channels []*EventsResponseChannel
}

type EventsResponseChannel

type EventsResponseChannel struct {
	*db.EventChannel
	Events []Event `json:"events"`
}

Jump to

Keyboard shortcuts

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