http

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2021 License: NCSA Imports: 52 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Ab = ab
)

Functions

func ConfigureAPI

func ConfigureAPI(api *operations.DlframeworkAPI) http.Handler

func LoginHandler added in v0.3.0

func LoginHandler(params authentication.LoginParams, principal *models.User) middleware.Responder

func LogoutHandler added in v0.3.0

func LogoutHandler(params authentication.LogoutParams) middleware.Responder

func RegistryFrameworkAgentsHandler

func RegistryFrameworkAgentsHandler(params registry.FrameworkAgentsParams) middleware.Responder

func RegistryFrameworkManifestsHandler

func RegistryFrameworkManifestsHandler(params registry.FrameworkManifestsParams) middleware.Responder

func RegistryModelAgentsHandler

func RegistryModelAgentsHandler(params registry.ModelAgentsParams) middleware.Responder

func RegistryModelManifestsHandler

func RegistryModelManifestsHandler(params registry.ModelManifestsParams) middleware.Responder

func ServeError

func ServeError(rw http.ResponseWriter, r *http.Request, err error)

ServeError the error handler interface implemenation

func SignupHandler added in v0.3.0

func SignupHandler(params authentication.SignupParams) middleware.Responder

func UserInfoHandler added in v0.3.0

func UserInfoHandler(params authentication.UserInfoParams) middleware.Responder

Types

type Error

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

func NewError

func NewError(name string, message error) *Error

func (*Error) Code

func (e *Error) Code() int32

func (*Error) Error

func (e *Error) Error() string

func (*Error) MarshalJSON

func (e *Error) MarshalJSON() ([]byte, error)

func (*Error) WithCode

func (e *Error) WithCode(code int) *Error

func (*Error) WithMessage

func (e *Error) WithMessage(message error) *Error

func (*Error) WithName

func (e *Error) WithName(name string) *Error

func (*Error) WriteResponse

func (e *Error) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)

type MemStorer added in v0.3.0

type MemStorer struct {
	Users  map[string]User
	Tokens map[string][]string
}

MemStorer stores users in memory Indexed by Username => must be unique TODO: verify that username is unique

func NewMemStorer added in v0.3.0

func NewMemStorer() *MemStorer

NewMemStorer constructor

func (MemStorer) AddRememberToken added in v0.3.0

func (m MemStorer) AddRememberToken(ctx context.Context, pid, token string) error

AddRememberToken to a user

func (MemStorer) Create added in v0.3.0

func (m MemStorer) Create(ctx context.Context, user authboss.User) error

Create the user

func (MemStorer) DelRememberTokens added in v0.3.0

func (m MemStorer) DelRememberTokens(ctx context.Context, pid string) error

DelRememberTokens removes all tokens for the given pid

func (MemStorer) Load added in v0.3.0

func (m MemStorer) Load(ctx context.Context, key string) (user authboss.User, err error)

Load the user

func (MemStorer) New added in v0.3.0

func (m MemStorer) New(ctx context.Context) authboss.User

New user creation

func (MemStorer) Save added in v0.3.0

func (m MemStorer) Save(ctx context.Context, user authboss.User) error

Save the user

func (MemStorer) UseRememberToken added in v0.3.0

func (m MemStorer) UseRememberToken(ctx context.Context, pid, token string) error

UseRememberToken finds the pid-token pair and deletes it. If the token could not be found return ErrTokenNotFound

type PredictHandler added in v0.2.16

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

func (*PredictHandler) Close added in v0.2.16

func (*PredictHandler) Dataset added in v0.2.16

func (*PredictHandler) Images added in v0.2.16

func (*PredictHandler) Open added in v0.2.16

func (*PredictHandler) Reset added in v0.2.16

func (*PredictHandler) URLs added in v0.2.16

type User added in v0.3.0

type User struct {
	ID int

	// Non-authboss related field
	FirstName   string
	LastName    string
	Affiliation string

	// Auth
	Email    string
	Username string
	Password string
}

User struct for authboss

func (User) GetEmail added in v0.3.0

func (u User) GetEmail() string

GetEmail from user

func (User) GetPID added in v0.3.0

func (u User) GetPID() string

GetPID from user

func (User) GetPassword added in v0.3.0

func (u User) GetPassword() string

GetPassword from user

func (*User) PutEmail added in v0.3.0

func (u *User) PutEmail(email string)

PutEmail into user

func (*User) PutPID added in v0.3.0

func (u *User) PutPID(pid string)

PutPID into user

func (*User) PutPassword added in v0.3.0

func (u *User) PutPassword(password string)

PutPassword into user

func (*User) PutUsername added in v0.3.0

func (u *User) PutUsername(username string)

PutUsername into user

Jump to

Keyboard shortcuts

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