service

package
v0.0.0-...-c0b5346 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConditionLimit = 20 //GET /api/condition/:jia_isu_uuid
)

backend側で勝手にとるlimit

Variables

This section is empty.

Functions

func GenerateDummyJWT

func GenerateDummyJWT(userID string, issuedAt time.Time) (string, error)

異なる秘密鍵でJWTを生成する

func GenerateHS256JWT

func GenerateHS256JWT(userID string, issuedAt time.Time) (string, error)

異なる暗号方式でJWTを生成する

func GenerateJWT

func GenerateJWT(userID string, issuedAt time.Time) (string, error)

認証に利用する JWT トークンを生成して返す。

func GenerateJWTWithInvalidType

func GenerateJWTWithInvalidType(userID string, issuedAt time.Time) (string, error)

jia_user_idの型がstringでないJWTを生成する

func GenerateJWTWithNoData

func GenerateJWTWithNoData(issuedAt time.Time) (string, error)

jia_user_idの無いJWTを生成する

func GenerateTamperedJWT

func GenerateTamperedJWT(userID1 string, userID2 string, issuedAt time.Time) (string, error)

偽装したJWTを生成する

Types

type AuthResponse

type AuthResponse struct {
}

type GetGraphRequest

type GetGraphRequest struct {
	Date int64 // unixtime
}

type GetIsuConditionRequest

type GetIsuConditionRequest struct {
	StartTime      *int64
	EndTime        int64
	ConditionLevel string
}

type GetIsuConditionResponse

type GetIsuConditionResponse struct {
	JIAIsuUUID     string `json:"jia_isu_uuid"`
	IsuName        string `json:"isu_name"`
	Timestamp      int64  `json:"timestamp"`
	IsSitting      bool   `json:"is_sitting"`
	Condition      string `json:"condition"`
	ConditionLevel string `json:"condition_level"`
	Message        string `json:"message"`
}

func (*GetIsuConditionResponse) NKeys

func (c *GetIsuConditionResponse) NKeys() int

func (*GetIsuConditionResponse) UnmarshalJSONObject

func (c *GetIsuConditionResponse) UnmarshalJSONObject(dec *gojay.Decoder, key string) error

type GetIsuConditionResponseArray

type GetIsuConditionResponseArray []GetIsuConditionResponse

func (*GetIsuConditionResponseArray) UnmarshalJSONArray

func (c *GetIsuConditionResponseArray) UnmarshalJSONArray(dec *gojay.Decoder) error

type GetMeResponse

type GetMeResponse struct {
	JIAUserID string `json:"jia_user_id"`
}

type GetTrendResponse

type GetTrendResponse []GetTrendResponseOne

func (*GetTrendResponse) UnmarshalJSONArray

func (t *GetTrendResponse) UnmarshalJSONArray(dec *gojay.Decoder) error

type GetTrendResponseOne

type GetTrendResponseOne struct {
	Character string          `json:"character"`
	Info      TrendConditions `json:"info"`
	Warning   TrendConditions `json:"warning"`
	Critical  TrendConditions `json:"critical"`
}

func (*GetTrendResponseOne) NKeys

func (t *GetTrendResponseOne) NKeys() int

func (*GetTrendResponseOne) UnmarshalJSONObject

func (t *GetTrendResponseOne) UnmarshalJSONObject(dec *gojay.Decoder, key string) error

type GraphData

type GraphData struct {
	Score      int                 `json:"score"`
	Percentage GraphDataPercentage `json:"percentage"`
}

type GraphDataPercentage

type GraphDataPercentage struct {
	Sitting      int `json:"sitting"`
	IsBroken     int `json:"is_broken"`
	IsDirty      int `json:"is_dirty"`
	IsOverweight int `json:"is_overweight"`
}

type GraphResponse

type GraphResponse []*GraphResponseOne

type GraphResponseOne

type GraphResponseOne struct {
	StartAt             int64      `json:"start_at"`
	EndAt               int64      `json:"end_at"`
	Data                *GraphData `json:"data"`
	ConditionTimestamps []int64    `json:"condition_timestamps"`
}

type InitializeResponse

type InitializeResponse struct {
	Language string `json:"language"`
}

type Isu

type Isu struct {
	ID                 int                      `json:"id"`
	JIAIsuUUID         string                   `json:"jia_isu_uuid"`
	Name               string                   `json:"name"`
	Character          string                   `json:"character"`
	LatestIsuCondition *GetIsuConditionResponse `json:"latest_isu_condition"`

	Icon           []byte `json:"-"`
	IconStatusCode int    //icon取得時のstatus code(200 or 304想定)
}

type JIAServiceRequest

type JIAServiceRequest struct {
	TargetBaseURL string `json:"target_base_url"`
	IsuUUID       string `json:"isu_uuid"`
}

type PostInitializeRequest

type PostInitializeRequest struct {
	JIAServiceURL string `json:"jia_service_url"`
}

type PostIsuConditionRequest

type PostIsuConditionRequest struct {
	IsSitting bool   `json:"is_sitting"`
	Condition string `json:"condition"`
	Message   string `json:"message"`
	Timestamp int64  `json:"timestamp"`
}

type PostIsuRequest

type PostIsuRequest struct {
	JIAIsuUUID string `json:"jia_isu_uuid"`
	IsuName    string `json:"isu_name"`
	Img        []byte
}

type SignoutResponse

type SignoutResponse struct {
}

type TrendCondition

type TrendCondition struct {
	IsuID     int   `json:"isu_id"`
	Timestamp int64 `json:"timestamp"`
}

func (*TrendCondition) NKeys

func (t *TrendCondition) NKeys() int

func (*TrendCondition) UnmarshalJSONObject

func (t *TrendCondition) UnmarshalJSONObject(dec *gojay.Decoder, key string) error

type TrendConditions

type TrendConditions []TrendCondition

func (*TrendConditions) UnmarshalJSONArray

func (t *TrendConditions) UnmarshalJSONArray(dec *gojay.Decoder) error

Jump to

Keyboard shortcuts

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