server

package
v0.0.0-...-bf7cbd6 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCurrentUser

func GetCurrentUser(ctx context.Context) string

Types

type AcceptInvitationRequest

type AcceptInvitationRequest struct {
	Code string `json:"code"`
}

type AcceptInvitationResponse

type AcceptInvitationResponse struct{}

type AuthServer

type AuthServer struct {
	Auth domain.AuthService
}

func (*AuthServer) SignUp

func (as *AuthServer) SignUp(w http.ResponseWriter, r *http.Request) (web.Data, error)

type AuthorizationService

type AuthorizationService interface {
	CanAwardCheevo(ctx context.Context, awarderID, recipientID, cheevoID string) error
	CanCreateCheevo(ctx context.Context, userID, orgID string) error
	CanGetCheevo(ctx context.Context, userID, cheevoID string) error
	CanInviteUsersToOrganization(ctx context.Context, userID, orgID string) error
	CanRefreshInvitation(ctx context.Context, userID, invitationID string) error
}

type AwardCheevoRequest

type AwardCheevoRequest struct {
	CheevoID    string `json:"cheevoID"`
	RecipientID string `json:"recipientID"`
}

type AwardCheevoResponse

type AwardCheevoResponse struct {
	CheevoID    string `json:"cheevoID"`
	RecipientID string `json:"recipientID"`
}

type CheevosServer

type CheevosServer struct {
	Authz   AuthorizationService
	Cheevos domain.CheevosService
	Roster  domain.RosterService
}

func (*CheevosServer) AwardCheevo

func (cs *CheevosServer) AwardCheevo(w http.ResponseWriter, r *http.Request) (web.Data, error)

func (*CheevosServer) CreateCheevo

func (cs *CheevosServer) CreateCheevo(w http.ResponseWriter, r *http.Request) (web.Data, error)

func (*CheevosServer) GetCheevo

func (cs *CheevosServer) GetCheevo(w http.ResponseWriter, r *http.Request) (web.Data, error)

type CreateCheevoRequest

type CreateCheevoRequest struct {
	Name           string `json:"name"`
	Description    string `json:"description"`
	OrganizationID string `json:"organizationID"`
}

type CreateCheevoResponse

type CreateCheevoResponse struct {
	ID             string `json:"id"`
	Name           string `json:"name"`
	Description    string `json:"description"`
	OrganizationID string `json:"organizationID"`
}

type CreateOrganizationRequest

type CreateOrganizationRequest struct {
	Name string `json:"name"`
}

type CreateOrganizationResponse

type CreateOrganizationResponse struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type DeclineInvitationRequest

type DeclineInvitationRequest struct {
	Code string `json:"code"`
}

type DeclineInvitationResponse

type DeclineInvitationResponse struct{}

type GetCheevoRequest

type GetCheevoRequest struct {
	CheevoID string `json:"cheevoID"`
}

type GetCheevoResponse

type GetCheevoResponse struct {
	ID             string `json:"id"`
	Name           string `json:"name"`
	Description    string `json:"description"`
	OrganizationID string `json:"organizationID"`
}

type InviteUserToOrganizationRequest

type InviteUserToOrganizationRequest struct {
	Email          string `json:"email"`
	OrganizationID string `json:"organizationID"`
}

type InviteUserToOrganizationResponse

type InviteUserToOrganizationResponse struct {
	Expires time.Time `json:"expires"`
}

type RefreshInvitationRequest

type RefreshInvitationRequest struct {
	InvitationID string `json:"invitationID"`
}

type RefreshInvitationResponse

type RefreshInvitationResponse struct {
	ID      string    `json:"id"`
	Expires time.Time `json:"expires"`
}

type RosterServer

type RosterServer struct {
	Authz  AuthorizationService
	Roster domain.RosterService
}

func (*RosterServer) AcceptInvitation

func (rs *RosterServer) AcceptInvitation(w http.ResponseWriter, r *http.Request) (web.Data, error)

func (*RosterServer) CreateOrganization

func (rs *RosterServer) CreateOrganization(w http.ResponseWriter, r *http.Request) (web.Data, error)

func (*RosterServer) DeclineInvitation

func (rs *RosterServer) DeclineInvitation(w http.ResponseWriter, r *http.Request) (web.Data, error)

func (*RosterServer) InviteUserToOrganization

func (rs *RosterServer) InviteUserToOrganization(w http.ResponseWriter, r *http.Request) (web.Data, error)

func (*RosterServer) RefreshInvitation

func (rs *RosterServer) RefreshInvitation(w http.ResponseWriter, r *http.Request) (web.Data, error)

type SignUpRequest

type SignUpRequest struct {
	Username string            `json:"username"`
	Password password.Password `json:"password"`
}

type SignUpResponse

type SignUpResponse struct {
	ID       string `json:"id"`
	Username string `json:"username"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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