Documentation ¶
Index ¶
- Constants
- func GetMe(accesstoken, secret string) (userid string, err error)
- func Routers(e *echo.Echo)
- type Client
- func (p *Client) Auth(c echo.Context) error
- func (p *Client) Callback(c echo.Context) error
- func (p *Client) CreatePost(c echo.Context) error
- func (p *Client) CreatePosts(c echo.Context) error
- func (p *Client) CreateScheduleForPost(c echo.Context) error
- func (p *Client) DeletePost(c echo.Context) error
- func (p *Client) DeleteScheduleForPost(c echo.Context) error
- func (p *Client) GetAccount(c echo.Context) error
- func (p *Client) GetAccounts(c echo.Context) error
- func (p *Client) GetPost(c echo.Context) error
- func (p *Client) GetPosts(c echo.Context) error
- func (p *Client) GetScheduleForPost(c echo.Context) error
- func (p *Client) Health(c echo.Context) error
- func (p *Client) IsUserChecker(ctx context.Context, token, username string) error
- func (p *Client) PostUpload(c echo.Context) error
- func (p *Client) PutAccount(c echo.Context) error
- func (p *Client) PutAccountForAuth(ctx context.Context, account models.Account) error
- func (p *Client) PutPost(c echo.Context) error
- func (p *Client) PutRule(c echo.Context) error
- func (p *Client) PutScheduleForPost(c echo.Context) error
- func (p *Client) ReadSpreadsheetForPost(id string) ([]models.Post, error)
- func (p *Client) Registor(c echo.Context) error
- func (p *Client) RequestForPost(v url.Values) error
- func (p *Client) ScheduleProcess(c echo.Context) error
- func (p *Client) ToGCS(c echo.Context) (string, error)
- func (p *Client) Usage(c echo.Context) error
- type Response
Constants ¶
const ( // firestore collection Users = "users" Accounts = "accounts" Rules = "rules" Posts = "posts" Schedules = "schedules" // bind key for map RTOKEN = "request_token" RTOKENSECRET = "request_token_secret" ACCESSTOKEN = "access_token" ACCESSTOKENSECRET = "access_token_secret" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { ProjectID string GUIURL string POSTAPIURL string Key string Secret string CallbackURL string PasswordController []byte CredentialFile string // SheetID @MasterFile SpreadID string SheetUserID string SheetPostID string RangeKey string Firestore *models.ClientForFirestore }
func (*Client) CreatePost ¶
CreatePost Postを新規作成 from form values
func (*Client) CreatePosts ¶
CreatePosts Postsを新規作成 query: spread_id
func (*Client) CreateScheduleForPost ¶
CreateScheduleForPost Postを新規作成 from form values
func (*Client) DeleteScheduleForPost ¶
DeleteScheduleForPost Postを削除
func (*Client) GetAccount ¶
func (*Client) GetAccounts ¶
GetAccounts 現在時刻に合致したアカウントを取得
func (*Client) GetScheduleForPost ¶
GetScheduleForPost Postを取得 query: post_id
func (*Client) IsUserChecker ¶
func (*Client) PostUpload ¶
func (*Client) PutAccountForAuth ¶
func (*Client) PutScheduleForPost ¶
PutScheduleForPost Postを更新 主にchecked, priorityの更新(削除除く)
func (*Client) ReadSpreadsheetForPost ¶
func (*Client) Registor ¶
Registor handles the form submission
1. フロントエンドからSpreadsheetIDを取得 2. セッションからアクセストークンを取得 3. 顧客のSpreadsheetIDの投稿データを読み込み 4. 顧客のSpreadsheetIDの投稿データ型式を確認 5. マスターファイルのユーザーデータを読み込み 6. 顧客SpreadsheetID及びTwitter/Xアカウントの重複チェックがマスターファイルにすでに存在しないかチェック 7. マスターファイルの投稿データを取得 8. マスターファイルの投稿データ末尾へ追記し更新
func (*Client) ScheduleProcess ¶
ScheduleProcess handles the form submission 1. 現在時刻を取得 2. 指定時間が合致するアカウントを取得 3. アカウントに紐づく投稿データを取得 4. 投稿データを選別 5. 投稿処理をリクエスト(別インスタンス 6. 投稿データを更新