Documentation
¶
Overview ¶
Package domains contains the types.
Package domains contains the types.
Package domains contains the types.
Index ¶
- Variables
- func LikeColumns() []string
- func LikePrimaryKeys() []string
- func LikeSummaryServerColumns() []string
- func LikeSummaryServerPrimaryKeys() []string
- type Exhibition
- type ExhibitionListRequest
- type ExhibitionListResp
- type ExhibitionRepo
- type Like
- func (l *Like) Delete(ctx context.Context) *spanner.Mutation
- func (l *Like) Insert(ctx context.Context) *spanner.Mutation
- func (l *Like) InsertOrUpdate(ctx context.Context) *spanner.Mutation
- func (*Like) IsNode()
- func (l *Like) Update(ctx context.Context) *spanner.Mutation
- func (l *Like) UpdateColumns(ctx context.Context, cols ...string) (*spanner.Mutation, error)
- type LikeRepo
- type LikeSummary
- type LikeSummaryListResp
- type LikeSummaryRepo
- type LikeSummaryServer
- func (lss *LikeSummaryServer) Delete(ctx context.Context) *spanner.Mutation
- func (lss *LikeSummaryServer) Insert(ctx context.Context) *spanner.Mutation
- func (lss *LikeSummaryServer) InsertOrUpdate(ctx context.Context) *spanner.Mutation
- func (lss *LikeSummaryServer) Update(ctx context.Context) *spanner.Mutation
- func (lss *LikeSummaryServer) UpdateColumns(ctx context.Context, cols ...string) (*spanner.Mutation, error)
- type Movie
- type MovieRepo
- type News
- type NewsListRequest
- type NewsListResp
- type NewsRepo
- type Session
- type SessionListRequest
- type SessionListResp
- type SessionRepo
- type Slide
- type SlideRepo
- type Speaker
- type SpeakerRepo
- type YODB
- type YORODB
Constants ¶
This section is empty.
Variables ¶
var YOLog = func(context.Context, string, ...interface{}) {}
YOLog provides the log func used by generated queries.
Functions ¶
func LikeColumns ¶
func LikeColumns() []string
func LikePrimaryKeys ¶
func LikePrimaryKeys() []string
func LikeSummaryServerColumns ¶
func LikeSummaryServerColumns() []string
func LikeSummaryServerPrimaryKeys ¶
func LikeSummaryServerPrimaryKeys() []string
Types ¶
type Exhibition ¶
type Exhibition struct { ID int Place string Title string TitleJa string Description string DescriptionJa string }
Exhibition has the exhibition data.
type ExhibitionListRequest ¶
ExhibitionListRequest provides option for ExhibitionRepo#List.
type ExhibitionListResp ¶
type ExhibitionListResp struct { List []*Exhibition LastKnownID int HasNext bool }
ExhibitionListResp provides response for ExhibitionRepo#List.
type ExhibitionRepo ¶
type ExhibitionRepo interface { Get(ctx context.Context, ids ...int) ([]*Exhibition, error) List(ctx context.Context, req *ExhibitionListRequest) (*ExhibitionListResp, error) }
ExhibitionRepo is basic operation unit for Exhibition.
func NewExhibitionRepo ¶
func NewExhibitionRepo() (ExhibitionRepo, error)
NewExhibitionRepo returns new ExhibitionRepo.
type Like ¶
type Like struct { UUID string `spanner:"Uuid" json:"Uuid"` // Uuid SessionID int64 `spanner:"SessionId" json:"SessionId"` // SessionId UserUUID string `spanner:"UserUUID" json:"UserUUID"` // UserUUID CreatedAt time.Time `spanner:"CreatedAt" json:"CreatedAt"` // CreatedAt }
Like represents a row from 'Likes'.
func (*Like) Insert ¶
Insert returns a Mutation to insert a row into a table. If the row already exists, the write or transaction fails.
func (*Like) InsertOrUpdate ¶
InsertOrUpdate returns a Mutation to insert a row into a table. If the row already exists, it updates it instead. Any column values not explicitly written are preserved.
type LikeRepo ¶
type LikeRepo interface { Insert(ctx context.Context, like *Like) (*Like, error) BulkInsert(ctx context.Context, like []Like) ([]Like, error) }
LikeRepo is basic operation unit for Like.
func NewFakeLikeRepo ¶
NewFakeLikeRepo returns new LikeRepo.
type LikeSummary ¶
LikeSummary has the like summary per second for session.
type LikeSummaryListResp ¶
type LikeSummaryListResp struct {
List []*LikeSummary
}
LikeSummaryListResp has a list of like summary per second for session.
type LikeSummaryRepo ¶
type LikeSummaryRepo interface { Insert(ctx context.Context, like *LikeSummaryServer) (*LikeSummaryServer, error) BulkInsert(ctx context.Context, like []*LikeSummaryServer) ([]*LikeSummaryServer, error) List(ctx context.Context, second int64) (*LikeSummaryListResp, error) }
LikeSummaryRepo is basic operation unit for LikeSummary.
func NewFakeLikeSummaryRepo ¶
func NewFakeLikeSummaryRepo() (LikeSummaryRepo, error)
NewFakeLikeSummaryRepo returns new LikeSummaryRepo.
func NewLikeSummaryRepo ¶
func NewLikeSummaryRepo(spannerClient *spanner.Client) (LikeSummaryRepo, error)
NewLikeSummaryRepo returns new LikeSummaryRepo.
type LikeSummaryServer ¶
type LikeSummaryServer struct { Second int64 `spanner:"Second" json:"Second"` // Second SessionID int64 `spanner:"SessionId" json:"SessionId"` // SessionId ServerID string `spanner:"ServerId" json:"ServerId"` // ServerId Likes int64 `spanner:"Likes" json:"Likes"` // Likes CreatedAt time.Time `spanner:"CreatedAt" json:"CreatedAt"` // CreatedAt }
LikeSummaryServer represents a row from 'LikeSummaryServers'.
func FindLikeSummaryServer ¶
func FindLikeSummaryServer(ctx context.Context, db YORODB, second int64, sessionID int64, serverID string) (*LikeSummaryServer, error)
FindLikeSummaryServer gets a LikeSummaryServer by primary key
func (*LikeSummaryServer) Delete ¶
func (lss *LikeSummaryServer) Delete(ctx context.Context) *spanner.Mutation
Delete deletes the LikeSummaryServer from the database.
func (*LikeSummaryServer) Insert ¶
func (lss *LikeSummaryServer) Insert(ctx context.Context) *spanner.Mutation
Insert returns a Mutation to insert a row into a table. If the row already exists, the write or transaction fails.
func (*LikeSummaryServer) InsertOrUpdate ¶
func (lss *LikeSummaryServer) InsertOrUpdate(ctx context.Context) *spanner.Mutation
InsertOrUpdate returns a Mutation to insert a row into a table. If the row already exists, it updates it instead. Any column values not explicitly written are preserved.
func (*LikeSummaryServer) Update ¶
func (lss *LikeSummaryServer) Update(ctx context.Context) *spanner.Mutation
Update returns a Mutation to update a row in a table. If the row does not already exist, the write or transaction fails.
func (*LikeSummaryServer) UpdateColumns ¶
func (lss *LikeSummaryServer) UpdateColumns(ctx context.Context, cols ...string) (*spanner.Mutation, error)
UpdateColumns returns a Mutation to update specified columns of a row in a table.
type MovieRepo ¶
type MovieRepo interface { ListByMoviesBySessionID(ctx context.Context, sessionID int) ([]Movie, error) ListByMoviesBySpeakerID(ctx context.Context, speakerID string) ([]Movie, error) }
MovieRepo is basic operation unit for Movie.
type NewsListRequest ¶
NewsListRequest provides option for NewsRepo#List.
type NewsListResp ¶
NewsListResp provides response for NewsRepo#List.
type NewsRepo ¶
type NewsRepo interface {
List(ctx context.Context, req *NewsListRequest) (*NewsListResp, error)
}
NewsRepo is basic operation unit for News.
type Session ¶
type Session struct { ID int Type string Place string Title string TitleJa string StartTime string EndTime string Outline string OutlineJa string Lang string Tags []string Liked int SpeakerIDs []string UpdatedAt time.Time }
Session has the session data.
type SessionListRequest ¶
SessionListRequest provides option for SessionRepo#List.
type SessionListResp ¶
SessionListResp provides response for SessionRepo#List.
type SessionRepo ¶
type SessionRepo interface { Get(ctx context.Context, ids ...int) ([]*Session, error) GetBySpeakerIDs(ctx context.Context, speakerIDs ...string) ([][]*Session, error) List(ctx context.Context, req *SessionListRequest) (*SessionListResp, error) AddLiked(ctx context.Context, id int, delta int) (*Session, error) }
SessionRepo is basic operation unit for Session.
func NewSessionRepo ¶
func NewSessionRepo() (SessionRepo, error)
NewSessionRepo returns new SessionRepo.
type SlideRepo ¶
type SlideRepo interface { ListBySessionID(ctx context.Context, sessionID int) ([]Slide, error) ListBySpeakerID(ctx context.Context, speakerID string) ([]Slide, error) }
SlideRepo is basic operation unit for Slide.
type Speaker ¶
type Speaker struct { ID string Name string NameJa string Company string Position string PositionJa string Profile string ProfileJa string IconURL string TwitterID string GithubID string }
Speaker has the speaker data.
type SpeakerRepo ¶
SpeakerRepo is basic operation unit for Speaker.
func NewSpeakerRepo ¶
func NewSpeakerRepo() (SpeakerRepo, error)
NewSpeakerRepo returns new SpeakerRepo.
type YORODB ¶
type YORODB interface { ReadRow(ctx context.Context, table string, key spanner.Key, columns []string) (*spanner.Row, error) Read(ctx context.Context, table string, keys spanner.KeySet, columns []string) *spanner.RowIterator ReadUsingIndex(ctx context.Context, table, index string, keys spanner.KeySet, columns []string) (ri *spanner.RowIterator) Query(ctx context.Context, statement spanner.Statement) *spanner.RowIterator }
YORODB is the common interface for database operations.