Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store interface { TableName() string Insert(ctx context.Context, tweet *Tweet) (time.Time, error) Update(ctx context.Context, id string) (*spanner.CommitResponse, error) UpdateDML(ctx context.Context, id string) (time.Time, error) Delete(ctx context.Context, id string) error Get(ctx context.Context, key spanner.Key) (*Tweet, error) Query(ctx context.Context, limit int) ([]*Tweet, error) QueryHeavy(ctx context.Context) ([]*Tweet, error) QueryAll(ctx context.Context) (int, error) QueryResultStruct(ctx context.Context, orderByAsc bool, limit int, tb *spanner.TimestampBound) ([]*TweetIDAndAuthor, error) QueryOrderByCreatedAtDesc(ctx context.Context, startShard int, endShard int, pageOption *PageOptionForQueryOrderByCreatedAtDesc, limit int) ([]*Tweet, error) QueryRandom(ctx context.Context) error }
Store is TweetTable Functions
type Tweet ¶
type Tweet struct { TweetID string Author string Content string ContentLength int64 // generated columns Favos []string Sort int64 ShardID int64 CreatedAt time.Time UpdatedAt time.Time CommitedAt time.Time // allow_commit_timestamp SchemaVersion int64 }
Tweet is TweetTable Row
func (*Tweet) ToInsertOrUpdateMap ¶
ToInsertOrUpdateMap is Tweet structから、InsertOrUpdateができないColumnを取り除いたmapを作る
InsertOrUpdateができないColumnとしては、generated columnsで生成されるcolumnがある
type TweetIDAndAuthor ¶
TweetIDAndAuthor is StructのResponseの確認用に作ったStruct
Click to show internal directories.
Click to hide internal directories.