router

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2022 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAlreadyClosed 既に閉じられています
	ErrAlreadyClosed = errors.New("already IsClosed")
	// ErrBufferIsFull 送信バッファが溢れました
	ErrBufferIsFull = errors.New("buffer is full")
)

Functions

func Setup

func Setup(repo repository.Repository) *echo.Echo

Types

type Client

type Client interface {
	Key() string
	UserID() uuid.UUID
	ListenRead()
	ListenWrite()
	PushMessage(*rawMessage) error
	IsClosed() bool
	Close() error
}

type Handlers

type Handlers struct {
	Repo repository.Repository

	SessionOption sessions.Options
	ClientID      string
	// contains filtered or unexported fields
}

func (*Handlers) CallbackHandler

func (h *Handlers) CallbackHandler(c echo.Context) error

CallbackHandler GET /api/callback

func (*Handlers) DeletePresentation

func (h *Handlers) DeletePresentation(c echo.Context) error

DeletePresentation DELETE /presentations/:presentationID

func (*Handlers) GetGeneratedCode

func (h *Handlers) GetGeneratedCode(c echo.Context) error

GetGeneratedCode GET /oauth2/generate/code

func (*Handlers) GetLiveID

func (h *Handlers) GetLiveID(c echo.Context) error

func (*Handlers) GetPresentation

func (h *Handlers) GetPresentation(c echo.Context) error

GetPresentation GET /presentations/:presentationID

func (*Handlers) GetPresentationComments

func (h *Handlers) GetPresentationComments(c echo.Context) error

GetPresentationComments GET /presentations/:presentationID/comments

func (*Handlers) GetPresentationReaction

func (h *Handlers) GetPresentationReaction(c echo.Context) error

GetPresentationReaction GET /presentations/:presentationID/reaction

func (*Handlers) GetPresentationReview

func (h *Handlers) GetPresentationReview(c echo.Context) error

GetPresentationReview GET /presentations/:presentationID/review

func (*Handlers) GetPresentations

func (h *Handlers) GetPresentations(c echo.Context) error

GetPresentations GET /presentations

func (*Handlers) GetUserMe

func (h *Handlers) GetUserMe(c echo.Context) error

HandleGetUserMe ヘッダー情報からuser情報を取得 認証状態を確認

func (*Handlers) GetViewer

func (h *Handlers) GetViewer(c echo.Context) error

GetViewer GET /viewer

func (*Handlers) IsAdminUserMiddleware

func (h *Handlers) IsAdminUserMiddleware(next echo.HandlerFunc) echo.HandlerFunc

AdminUserMiddleware 管理者ユーザーか判定するミドルウェア

func (*Handlers) IsTraQUserMiddleware

func (h *Handlers) IsTraQUserMiddleware(next echo.HandlerFunc) echo.HandlerFunc

TraQUserMiddleware traQユーザーか判定するミドルウェア

func (*Handlers) PatchPresentation

func (h *Handlers) PatchPresentation(c echo.Context) error

PatchPresentation PATCH /presentations/:presentationID

func (*Handlers) PatchPresentationReview

func (h *Handlers) PatchPresentationReview(c echo.Context) error

PatchPresentationReview PATCH /presentations/:presentationID/review

func (*Handlers) PostPresentationReview

func (h *Handlers) PostPresentationReview(c echo.Context) error

PostPresentationReview POST /presentations/:presentationID/review

func (*Handlers) PostPresentations

func (h *Handlers) PostPresentations(c echo.Context) error

PostPresentations POST /presentations

func (*Handlers) PostState

func (h *Handlers) PostState(c echo.Context) error

PostState POST /state

func (*Handlers) PostToken

func (h *Handlers) PostToken(c echo.Context) error

func (*Handlers) PutLiveID

func (h *Handlers) PutLiveID(c echo.Context) error

func (*Handlers) TraQUserMiddleware

func (h *Handlers) TraQUserMiddleware(next echo.HandlerFunc) echo.HandlerFunc

type Live

type Live struct {
	ID string `json:"liveId"`
}

type PatchPresentationsStruct

type PatchPresentationsStruct struct {
	Name        utils.String `json:"name"`
	Speakers    utils.String `json:"speakers"`
	Description utils.String `json:"description"`
}

type PostPresentationsStruct

type PostPresentationsStruct struct {
	Name        string `json:"name"`
	Speakers    string `json:"speakers"`
	Description string `json:"description"`
}

type PostReviewStruct

type PostReviewStruct struct {
	Skill        int `json:"skill" db:"skill"`
	Artistry     int `json:"artistry" db:"artistry"`
	Idea         int `json:"idea" db:"idea"`
	Presentation int `json:"presentation" db:"presentation"`
}

type ResponseToken

type ResponseToken struct {
	Token string `json:"token"`
}

type Streamer

type Streamer struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Streamer WebSocketストリーマー

func NewStreamer

func NewStreamer(repo repository.Repository) *Streamer

NewStreamer WebSocketストリーマーを生成し起動します

func (*Streamer) Close

func (s *Streamer) Close() error

Close ストリーマーを停止します

func (*Streamer) IsClosed

func (s *Streamer) IsClosed() bool

IsClosed ストリーマーが停止しているかどうか

func (*Streamer) IsClosedWithoutLock

func (s *Streamer) IsClosedWithoutLock() bool

IsClosedWithoutLock ストリーマーが停止しているかどうか

func (*Streamer) SendAll

func (s *Streamer) SendAll(m *rawMessage)

SendAll すべてのclientにメッセージを送る

func (*Streamer) SendState

func (s *Streamer) SendState(st *State)

SendState すべてのclientに新しいstateを送る

func (*Streamer) ServeHTTP

func (s *Streamer) ServeHTTP(c echo.Context) error

ServeHTTP GET /ws

type TokenResponse

type TokenResponse struct {
	AccessToken  string `json:"access_token"`
	TokenType    string `json:"token_type"`
	ExpiresIn    int    `json:"expires_in"`
	RefreshToken string `json:"refresh_token"`
	Scope        string `json:"scope"`
	IDToken      string `json:"id_token"`
}

Jump to

Keyboard shortcuts

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