api

package
v0.0.0-...-b770fee Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2018 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const MaxFileSize = 500 * 1024 * 1024 // 500MB max

Variables

View Source
var SlugReg = regexp.MustCompile("^[a-zA-Z0-9_]*$")

Functions

func DELETE

func DELETE(r *httprouter.Router, path string, handler Handler)

func GET

func GET(r *httprouter.Router, path string, handler Handler)

func HandleAuthUser

func HandleAuthUser(c *Context, w http.ResponseWriter, req *http.Request)

func HandleCreateModel

func HandleCreateModel(c *Context, w http.ResponseWriter, req *http.Request)

func HandleDeleteModel

func HandleDeleteModel(c *Context, w http.ResponseWriter, req *http.Request)

func HandleFile

func HandleFile(c *Context, w http.ResponseWriter, req *http.Request)

func HandleFileById

func HandleFileById(c *Context, w http.ResponseWriter, req *http.Request)

func HandleFileUpload

func HandleFileUpload(c *Context, w http.ResponseWriter, req *http.Request)

func HandleFileVersions

func HandleFileVersions(c *Context, w http.ResponseWriter, req *http.Request)

func HandleIndex

func HandleIndex(c *Context, w http.ResponseWriter, req *http.Request)

func HandleLatestFilesByUsernameAndSlug

func HandleLatestFilesByUsernameAndSlug(c *Context, w http.ResponseWriter, req *http.Request)

func HandleLatestPublicModels

func HandleLatestPublicModels(c *Context, w http.ResponseWriter, req *http.Request)

func HandleLogin

func HandleLogin(c *Context, w http.ResponseWriter, req *http.Request)

func HandleLogout

func HandleLogout(c *Context, w http.ResponseWriter, req *http.Request)

func HandleModelByUsernameAndSlug

func HandleModelByUsernameAndSlug(c *Context, w http.ResponseWriter, req *http.Request)

func HandleModelsByUsername

func HandleModelsByUsername(c *Context, w http.ResponseWriter, req *http.Request)

func HandleRegister

func HandleRegister(c *Context, w http.ResponseWriter, req *http.Request)

func HandleTopPublicModels

func HandleTopPublicModels(c *Context, w http.ResponseWriter, req *http.Request)

func HandleUpdateModelReadme

func HandleUpdateModelReadme(c *Context, w http.ResponseWriter, req *http.Request)

func HandleUpdateStripe

func HandleUpdateStripe(c *Context, w http.ResponseWriter, req *http.Request)

func HandleUserByUsername

func HandleUserByUsername(c *Context, w http.ResponseWriter, req *http.Request)

func JsonErr

func JsonErr(msg string) map[string]string

func Main

func Main()

func OPTIONS

func OPTIONS(r *httprouter.Router, path string, handler Handler)

func PATCH

func PATCH(r *httprouter.Router, path string, handler Handler)

func POST

func POST(r *httprouter.Router, path string, handler Handler)

func PUT

func PUT(r *httprouter.Router, path string, handler Handler)

Types

type Context

type Context struct {
	Render    *render.Render
	Params    httprouter.Params
	AuthToken *models.AuthToken
	User      *models.User
	Api       *models.ApiCollection
	Blob      blobstorage.BlobStorage
}

type CreateModelForm

type CreateModelForm struct {
	Slug        string `json:"slug"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Visibility  string `json:"visibility"`
	Keep        int    `jsno:"keep"`
}

type Handler

type Handler func(c *Context, w http.ResponseWriter, req *http.Request)

func Authed

func Authed(h Handler) Handler

type LoginForm

type LoginForm struct {
	EmailOrUsername string `json:"email_or_username"`
	Password        string `json:"password"`
}

type PaymentForm

type PaymentForm struct {
	StripeToken string `json:"stripe_token"`
}

type RegisterForm

type RegisterForm struct {
	Email    string `json:"email"`
	Username string `json:"username"`
	Password string `json:"password"`
}

type UpdateModelReadmeForm

type UpdateModelReadmeForm struct {
	Readme string `json:"readme"`
}

Jump to

Keyboard shortcuts

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