http

package
v0.2.23-0...-4aaa12c Latest Latest
Warning

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

Go to latest
Published: May 17, 2020 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

func LoginHandler(params authentication.LoginParams, principal *models.User) 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

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

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

func NewMemStorer() *MemStorer

NewMemStorer constructor

func (MemStorer) AddRememberToken

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

AddRememberToken to a user

func (MemStorer) Create

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

Create the user

func (MemStorer) DelRememberTokens

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

DelRememberTokens removes all tokens for the given pid

func (MemStorer) Load

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

Load the user

func (MemStorer) New

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

New user creation

func (MemStorer) Save

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

Save the user

func (MemStorer) UseRememberToken

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

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

func (*PredictHandler) Close

func (*PredictHandler) Dataset

func (*PredictHandler) Images

func (*PredictHandler) Open

func (*PredictHandler) Reset

func (*PredictHandler) URLs

type User

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

func (u User) GetEmail() string

GetEmail from user

func (User) GetPID

func (u User) GetPID() string

GetPID from user

func (User) GetPassword

func (u User) GetPassword() string

GetPassword from user

func (*User) PutEmail

func (u *User) PutEmail(email string)

PutEmail into user

func (*User) PutPID

func (u *User) PutPID(pid string)

PutPID into user

func (*User) PutPassword

func (u *User) PutPassword(password string)

PutPassword into user

func (*User) PutUsername

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