ff14cf

package module
v0.0.0-...-e3be991 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2023 License: MIT Imports: 19 Imported by: 0

README

ff14cf

Local

go run cmd/server/main.go

configer run

go run github.com/sinmetal/ff14cf/cmd/configer

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDirectory = errors.New("path is directory")

ErrDirectory is target path is Directory

View Source
var ErrLodeStoneCharacterNotFound = fmt.Errorf("loadstone character notfound")
View Source
var ErrLodeStoneInvalidFormat = fmt.Errorf("loadstone response invalid format")

Functions

func GetFF14CharacterNameFromLodeStone

func GetFF14CharacterNameFromLodeStone(ctx context.Context, characterID string) (firstName string, lastName string, err error)

func MakeRandomStr

func MakeRandomStr(digit uint32) (string, error)

Types

type Content

type Content struct {
	// ContentID is URLで表示するID
	// $ReleaseVolume-Kind-Grade-英語版コンテンツの名前を適当に3文字ぐらいにしたもの
	// e.g. 極ガルーダ討滅戦 RR-TR-EX-HE
	ContentID string `firestore:"-" json:"contentID"`

	// Name is コンテンツ名
	Name string `json:"name"`

	// NameID is IDに使うName
	// 英語版コンテンツの名前を適当に3文字ぐらいにしたもの
	// https://na.finalfantasyxiv.com/lodestone/playguide/db/duty/
	NameID string `json:"nameID"`

	// ReleaseVersion is 新生, 蒼天など
	ReleaseVersion enum.ReleaseVersion `json:"releaseVersion"`

	// ContentKind is 討滅戦, アライアンスレイドなど
	ContentKind enum.ContentKind `json:"contentKind"`

	// ContentDifficulty is 極, 絶などのグレード
	// アルテマウェポンなどは極もあるが、その上の絶もあるので、それをフィルタリングするために使う
	ContentDifficulty enum.ContentDifficulty `json:"contentDifficulty"`

	// エオルゼアデータベースURL JP
	EorzeaDatabaseJPURL string `json:"eorzeaDatabaseJPURL"`

	// Persons is 参加人数
	// アライアンスレイドは24人なのか、8人なのか・・・
	Persons int `json:"persons"`

	// MinItemLevel 最低平均アイテムレベル
	MinItemLevel int `json:"minItemLevel"`

	// SearchAlias is 検索に利用するコンテンツ名の別名
	// e.g. 極ガルーダ討滅戦 -> ガルーダ
	SearchAlias []string `json:"searchAlias"`

	// OpenedUsers is 開放済みのUserList
	OpenedUsers []string `json:"openedUsers"`

	// CompletedUsers is LevelSyncでクリアしているUserList
	CompletedUsers []string `json:"completedUsers"`

	CreatedAt time.Time `json:"createdAt"`
}

func (*Content) NewContentID

func (c *Content) NewContentID() string

type ContentStore

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

func NewContentStore

func NewContentStore(ctx context.Context, fs *firestore.Client) (*ContentStore, error)

func (*ContentStore) CollectionName

func (s *ContentStore) CollectionName() string

func (*ContentStore) CollectionRef

func (s *ContentStore) CollectionRef() *firestore.CollectionRef

func (*ContentStore) Create

func (s *ContentStore) Create(ctx context.Context, value *Content) (*Content, error)

func (*ContentStore) Get

func (s *ContentStore) Get(ctx context.Context, contentID string) (*Content, error)

func (*ContentStore) GetBySearchAlias

func (s *ContentStore) GetBySearchAlias(ctx context.Context, contentName string) (*Content, error)

type ContentsHandler

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

ContentsHandler is FF14 Contentsを表示するハンドラ

func NewContentsHandler

func NewContentsHandler(ctx context.Context, contentStore *ContentStore) (*ContentsHandler, error)

func (*ContentsHandler) Handle

func (h *ContentsHandler) Handle(w http.ResponseWriter, r *http.Request)

type ContentsQuizHandler

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

func NewContentsQuizHandler

func NewContentsQuizHandler(ctx context.Context, contentStore *ContentStore) (*ContentsQuizHandler, error)

func (*ContentsQuizHandler) Handle

type ContentsQuizReq

type ContentsQuizReq struct {
	ContentID       string `json:"contentID"`
	ContentQuizName string `json:"contentQuizName"`
}

type LoadStoneGetResponse

type LoadStoneGetResponse struct {
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
}

type LoadStoneHandler

type LoadStoneHandler struct {
}

func NewLoadStoneHandler

func NewLoadStoneHandler(ctx context.Context) (*LoadStoneHandler, error)

func (*LoadStoneHandler) Handle

func (h *LoadStoneHandler) Handle(w http.ResponseWriter, r *http.Request)

type RegisterErrorResponse

type RegisterErrorResponse struct {
	Message string `json:"message"`
}

type RegisterHandler

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

func NewRegisterHandler

func NewRegisterHandler(ctx context.Context, userStore *UserStore) (*RegisterHandler, error)

func (*RegisterHandler) Handle

func (h *RegisterHandler) Handle(w http.ResponseWriter, r *http.Request)

type RegisterReq

type RegisterReq struct {
	CharacterID string `json:"characterID"`
}

type StaticContentsHandler

type StaticContentsHandler struct {
}

func NewStaticContentsHandler

func NewStaticContentsHandler(ctx context.Context) (*StaticContentsHandler, error)

func (*StaticContentsHandler) Handler

type User

type User struct {
	// UserID is LodeStoneCharacterIDでいいか?
	// https://jp.finalfantasyxiv.com/lodestone/character/%d/
	UserID string `firestore:"-" json:"userID"`

	// ViewID is URLとして利用する値
	// FirstName-LastName-適当な4文字
	ViewID string `json:"viewID"`

	// FirstName is Game内FirstName
	FirstName string `json:"firstName"`

	// LastName is Game内LastName
	LastName string `json:"lastName"`

	// HomeWorld is Game内HomeWorld
	HomeWorld string `json:"homeWorld"`

	// OpenedContents is 開放済みコンテンツ一覧
	OpenedContents []string `json:"openedContents"`

	// CompletedContents is クリア済みコンテンツ一覧
	CompletedContents []string `json:"completedContents"`

	CreatedAt time.Time `firestore:",serverTimestamp" json:"createdAt"`
}

type UserStore

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

func NewUserStore

func NewUserStore(ctx context.Context, fs *firestore.Client) (*UserStore, error)

func (*UserStore) CollectionName

func (s *UserStore) CollectionName() string

func (*UserStore) CollectionRef

func (s *UserStore) CollectionRef() *firestore.CollectionRef

func (*UserStore) Create

func (s *UserStore) Create(ctx context.Context, user *User) (*User, error)

func (*UserStore) NewViewID

func (s *UserStore) NewViewID(ctx context.Context, firstName string, lastName string) (string, error)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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