Documentation ¶
Index ¶
- Constants
- func CheckColumns(df dataframe.DataFrame) error
- func CheckDupID(id, spreadID string, accounts []Account) error
- func CheckDuplicate(str []string) []string
- func CheckPasswordHash(password, hash string) bool
- func DecryptPassword(ciphertext string, key []byte) (string, error)
- func DfNrowToLastNrow(df dataframe.DataFrame) int
- func EncryptPassword(password string, key []byte) (string, error)
- func GenerateKey() ([]byte, error)
- func GetUniqueKeys[T any](data []T, extractor GetUniqueExtractor[T]) []string
- func IsTime(times []time.Time, t time.Time) bool
- func Mask(s string) string
- func StrUpsideDown(s string) string
- func ToHash(password string) (string, error)
- type Account
- type Claims
- type ClientForFirestore
- func (p *ClientForFirestore) Get(ctx context.Context, colName, docKey string, data any) error
- func (p *ClientForFirestore) IsExist(ctx context.Context, colName string, docKeys ...string) (isExistKeys []string, err error)
- func (p *ClientForFirestore) NewClient(ctx context.Context) (*firestore.Client, error)
- func (p *ClientForFirestore) Set(ctx context.Context, colName, docKey string, data any) error
- type GetUniqueExtractor
- type Group
- type Post
- type Rule
- type Schedule
- type SubscribedPlan
- type TypeSchedule
Constants ¶
View Source
const KEYSIZE = 32
KEYSIZE AES-256-GCMに必要なキーのサイズ
Variables ¶
This section is empty.
Functions ¶
func CheckColumns ¶
func CheckDupID ¶
CheckDupID SpreadID, UserIDの重複を確認
func CheckPasswordHash ¶
func DecryptPassword ¶
DecryptPassword は、与えられた暗号文を復号化します
func DfNrowToLastNrow ¶
DfNrowToLastNrow Nrowを末尾に追加するためのNrowを返す
func EncryptPassword ¶
EncryptPassword は、与えられたパスワードを暗号化します
func GetUniqueKeys ¶
func GetUniqueKeys[T any](data []T, extractor GetUniqueExtractor[T]) []string
GetUniqueKeys は汎用的な型 T のスライスに対応し、ユニークなキーのリストを返します。 extractor パラメータは、各要素からキーを抽出する関数です。
Types ¶
type Account ¶
type Account struct { UUID string `csv:"uuid" dataframe:"uuid" firestore:"uuid,omitempty" json:"uuid,omitempty"` ID string `csv:"id" dataframe:"id" firestore:"id,omitempty" json:"id,omitempty"` Password string `csv:"password" dataframe:"password" firestore:"password,omitempty" json:"password,omitempty"` SpreadID string `csv:"spread_id" dataframe:"spread_id" firestore:"spread_id,omitempty" json:"spread_id,omitempty"` AccessToken string `csv:"access_token" dataframe:"access_token" firestore:"access_token,omitempty" json:"access_token,omitempty"` AccessSecret string `csv:"access_secret" dataframe:"access_secret" firestore:"access_secret,omitempty" json:"access_secret,omitempty"` Subscribed SubscribedPlan `csv:"subscribed" dataframe:"subscribed" firestore:"subscribed,omitempty" json:"subscribed,omitempty"` }
func NewAccount ¶
NewAccountForFree 初回会員登録用
func (*Account) SetSubscribed ¶
func (a *Account) SetSubscribed(level SubscribedPlan) *Account
SetSubscribed 有料プランの設定
type Claims ¶
type Claims struct { ID string `firestore:"id" json:"id,omitempty"` AccessToken string `firestore:"access_token" json:"access_token,omitempty"` AccessSecret string `firestore:"access_secret" json:"access_secret,omitempty"` // Auth Request Token RequestToken string `firestore:"request_token" json:"request_token,omitempty"` RequestTokenSecret string `firestore:"request_token_secret" json:"request_token_secret,omitempty"` SpreadsheetID string `firestore:"spreadsheet_id" json:"spreadsheet_id,omitempty"` }
type ClientForFirestore ¶
type GetUniqueExtractor ¶
GetUniqueExtractor は一意なキーを取得する関数型
type Group ¶
type Group struct { ParentPostId string `firestore:"parentPost_id" csv:"-" json:"parent_post_id,omitempty"` OwnerId string `firestore:"owner_id" csv:"-" json:"owner_id,omitempty"` // IsOn: 連投投稿のグループかどうか IsOn bool `firestore:"is_on,omitempty" csv:"-" json:"is_on,omitempty"` ChildPostIds []string `firestore:"post_id,omitempty" csv:"-" json:"child_post_ids,omitempty"` }
Group struct: 連投投稿のグループを表す ParentPostId: 親投稿のID
type Post ¶
type Post struct { UUID string `csv:"uuid" dataframe:"uuid" firestore:"uuid,omitempty" json:"uuid,omitempty"` // ID is Twitter/X AccountID ID string `csv:"id" dataframe:"id" firestore:"id" json:"id,omitempty"` Text string `csv:"text" dataframe:"text" firestore:"text" json:"text,omitempty"` File1 string `csv:"file1" dataframe:"file1" firestore:"file_1,omitempty" json:"file_1,omitempty"` File2 string `csv:"file2" dataframe:"file2" firestore:"file_2,omitempty" json:"file_2,omitempty"` File3 string `csv:"file3" dataframe:"file3" firestore:"file_3,omitempty" json:"file_3,omitempty"` File4 string `csv:"file4" dataframe:"file4" firestore:"file_4,omitempty" json:"file_4,omitempty"` WithFiles int `csv:"with_files" dataframe:"with_files" firestore:"with_files" json:"with_files,omitempty"` Checked int `csv:"checked" dataframe:"checked" firestore:"checked" json:"checked,omitempty"` Priority int `csv:"priority" dataframe:"priority" firestore:"priority" json:"priority,omitempty"` Count int `csv:"count" dataframe:"count" firestore:"count,omitempty" json:"count,omitempty"` PostURL string `csv:"post_url" dataframe:"post_url" firestore:"post_url,omitempty" json:"post_url,omitempty"` IsSchedule bool `csv:"is_schedule" dataframe:"is_schedule" firestore:"is_schedule" json:"is_schedule,omitempty"` // 以下は、csv, dataframeには含まれない IsDelete bool `csv:"-" dataframe:"-" firestore:"is_delete" json:"-,omitempty"` LastPostedAt time.Time `csv:"-" dataframe:"-" firestore:"last_posted_at,omitempty" json:"last_posted_at,omitempty"` CreatedAt time.Time `csv:"-" dataframe:"-" firestore:"created_at,omitempty" json:"created_at,omitempty"` }
func (*Post) IsPastLastPostedAt ¶
IsLastPostedAt LastPostedAtの時間を比較 More than the specified time has elapsed.
func (*Post) SetCreateAt ¶
func (*Post) SetLastPostedAt ¶
func (*Post) ToURLValues ¶
ToURLValues PostID, AccountIDをURLValuesに変換 この値を使って、Firestore[Accounts,Posts]からデータを取得する
type Rule ¶
type Rule struct { UUID string `csv:"-" dataframe:"uuid" firestore:"uuid,omitempty" json:"uuid,omitempty"` // IsDisenable is a flag for enable posting. // why: 一時的な投稿停止を行うためのフラグ。投稿停止中は投稿を行わない。 IsDisenable bool `csv:"-" dataframe:"is_disenable" firestore:"is_disenable,omitempty" json:"is_disenable,omitempty"` // IsImmediate is a flag for immediate posting. IsImmediate bool `csv:"-" dataframe:"is_immediate" firestore:"is_immediate,omitempty" json:"is_immediate,omitempty"` // IsScheduleAllPosts 同時刻のスケジュール予約がある場合、全ての投稿を有効にするかどうか // why: 複数投稿を同時刻に行う場合、全ての投稿を有効にするかどうかを設定する。年・月・週指定の同時刻投稿を行いたい。 IsScheduleAllPosts bool `csv:"-" dataframe:"is_schedule_all_posts" firestore:"is_schedule_all_posts,omitempty" json:"is_schedule_all_posts,omitempty"` // 投稿期間: 投稿情報の投稿最終時間からの計画時間 // TermHours is the default posting period. TermHours int `csv:"-" dataframe:"term_hours" firestore:"term_hours,omitempty" json:"term_hours,omitempty"` // 投稿時間群 // Times is setting multiple times. Rule.Times > Schedule.Times Times []time.Time `csv:"-" dataframe:"times" firestore:"times,omitempty" json:"times,omitempty"` }
Rule is a struct that represents the setting of a row.
type Schedule ¶
type Schedule struct { PostID string `csv:"-" dataframe:"post_id" firestore:"post_id,omitempty" json:"post_id,omitempty"` OwnerId string `csv:"-" dataframe:"owner_id" firestore:"owner_id,omitempty" json:"owner_id,omitempty"` IsSchedule bool `csv:"-" dataframe:"is_schedule" firestore:"is_schedule,omitempty" json:"is_schedule,omitempty"` // IsImmediate is a flag for immediate posting. // 即時投稿設定 IsImmediate bool `csv:"-" dataframe:"is_immediate" firestore:"is_immediate,omitempty" json:"is_immediate,omitempty"` TypeSchedule TypeSchedule `csv:"-" dataframe:"type_schedule" firestore:"type_schedule,omitempty" json:"type_schedule,omitempty"` // Month is the day of the month. // set day Month time.Month `csv:"-" dataframe:"month" firestore:"month,omitempty" json:"month,omitempty"` // Day is the day. Day int `csv:"-" dataframe:"day" firestore:"day,omitempty" json:"day,omitempty"` // Week is the day of the week. // set weekday Week time.Weekday `csv:"-" dataframe:"week" firestore:"week,omitempty" json:"week,omitempty"` // Times is setting multiple times. Times []time.Time `csv:"-" dataframe:"times" firestore:"times,omitempty" json:"times,omitempty"` }
Schedule is a struct for scheduling posts.
type SubscribedPlan ¶
type SubscribedPlan uint8
const ( Unsubscribed SubscribedPlan = iota SubscribedFree SubscribedBasic SubscribedPro )
type TypeSchedule ¶
type TypeSchedule int
const ( None TypeSchedule = iota Yearly // 1年ごと Monthly // 1ヶ月ごと Weekly // 1週間ごと Daily // 1日ごと )
func (TypeSchedule) String ¶
func (p TypeSchedule) String() string
Click to show internal directories.
Click to hide internal directories.