Documentation ¶
Index ¶
- Constants
- func FirebaseApp(ctx context.Context) (*firebase.App, error)
- func FirestoreClient(ctx context.Context) (*firestore.Client, error)
- func GrpcErrorStatusCode(err error) codes.Code
- type Auth
- type AuthRepository
- type AuthRepositoryInterface
- type CommonRepository
- type CommonRepositoryInterface
- type InviteRepository
- func (re *InviteRepository) Create(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, ...) error
- func (re *InviteRepository) Delete(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, ...) error
- func (re *InviteRepository) DeleteByUserID(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, ...) error
- func (re *InviteRepository) Find(ctx context.Context, f *firestore.Client, code string) (*model.Invite, error)
- func (re *InviteRepository) FindByUserID(ctx context.Context, f *firestore.Client, userID string) (*model.Invite, error)
- type InviteRepositoryInterface
- type ItemKey
- type ItemRepository
- func (re *ItemRepository) Create(ctx context.Context, f *firestore.Client, userID string, i *model.Item) error
- func (re *ItemRepository) Delete(ctx context.Context, f *firestore.Client, userID string, i *model.DeleteItem) error
- func (re *ItemRepository) GetCountUserMultipleInPeriod(ctx context.Context, f *firestore.Client, sip SearchItemParam) (int, error)
- func (re *ItemRepository) GetItem(ctx context.Context, f *firestore.Client, userID string, id string) (*model.Item, error)
- func (re *ItemRepository) GetItemUserMultipleInPeriod(ctx context.Context, f *firestore.Client, sip SearchItemParam, first int, ...) ([]*model.Item, error)
- func (re *ItemRepository) GetItemsInDate(ctx context.Context, f *firestore.Client, userID string, date time.Time) ([]*model.Item, error)
- func (re *ItemRepository) GetItemsInPeriod(ctx context.Context, f *firestore.Client, userID string, startDate time.Time, ...) ([]*model.Item, error)
- func (re *ItemRepository) Update(ctx context.Context, f *firestore.Client, userID string, i *model.UpdateItem, ...) error
- type ItemRepositoryInterface
- type ItemsInPeriodCursor
- type PushTokenRepository
- func (re *PushTokenRepository) Create(ctx context.Context, f *firestore.Client, userID string, i *model.PushToken) error
- func (re *PushTokenRepository) GetItems(ctx context.Context, f *firestore.Client, userID string) ([]*model.PushToken, error)
- func (re *PushTokenRepository) GetTokens(ctx context.Context, f *firestore.Client, userID string) []string
- type PushTokenRepositoryInterface
- type RelationshipCursor
- type RelationshipData
- type RelationshipInterface
- type RelationshipRepository
- func (re *RelationshipRepository) Create(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, ...) error
- func (re *RelationshipRepository) Delete(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, ...) error
- func (re *RelationshipRepository) ExistByFollowedID(ctx context.Context, f *firestore.Client, userID string) (bool, error)
- func (re *RelationshipRepository) Find(ctx context.Context, f *firestore.Client, i *model.Relationship) (*model.Relationship, error)
- func (re *RelationshipRepository) FindByFollowedID(ctx context.Context, f *firestore.Client, userID string, first int, ...) ([]*model.Relationship, error)
- type RelationshipRequestCursor
- type RelationshipRequestData
- type RelationshipRequestInterface
- type RelationshipRequestRepository
- func (re *RelationshipRequestRepository) Create(ctx context.Context, f *firestore.Client, i *model.RelationshipRequest) error
- func (re *RelationshipRequestRepository) DeleteByFollowedID(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, ...) error
- func (re *RelationshipRequestRepository) DeleteByFollowerID(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, ...) error
- func (re *RelationshipRequestRepository) Find(ctx context.Context, f *firestore.Client, i *model.RelationshipRequest) (*model.RelationshipRequest, error)
- func (re *RelationshipRequestRepository) FindByFollowedID(ctx context.Context, f *firestore.Client, userID string, first int, ...) ([]*model.RelationshipRequest, error)
- func (re *RelationshipRequestRepository) Update(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, ...) error
- type SearchItemParam
- type User
- type UserRepository
- func (re *UserRepository) Create(ctx context.Context, f *firestore.Client, u *model.User) error
- func (re *UserRepository) Delete(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, ...) error
- func (re *UserRepository) ExistByFirebaseUID(ctx context.Context, f *firestore.Client, fUID string) (bool, error)
- func (re *UserRepository) FindByFirebaseUID(ctx context.Context, f *firestore.Client, fUID string) (*model.User, error)
- func (re *UserRepository) FindByUID(ctx context.Context, f *firestore.Client, uid string) (*model.User, error)
- func (re *UserRepository) FindDatabaseDataByUID(ctx context.Context, f *firestore.Client, uid string) (*User, error)
- func (re *UserRepository) FindInUID(ctx context.Context, f *firestore.Client, uid []string) ([]*model.User, error)
- func (re *UserRepository) Update(ctx context.Context, f *firestore.Client, u *model.User) error
- func (re *UserRepository) UpdateFirebaseUID(ctx context.Context, f *firestore.Client, user *User) error
- type UserRepositoryInterface
Constants ¶
const ( RelationshipRequestStatusRequest = 1 RelationshipRequestStatusOK = 2 RelationshipRequestStatusNG = 3 )
Variables ¶
This section is empty.
Functions ¶
func FirebaseApp ¶
FirebaseApp Firebase App
func FirestoreClient ¶
FirestoreClient Firestore Client
func GrpcErrorStatusCode ¶
Types ¶
type AuthRepository ¶
type AuthRepository struct { }
type AuthRepositoryInterface ¶
type AuthRepositoryInterface interface {
Delete(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, uid string) error
}
func NewAuthRepository ¶
func NewAuthRepository() AuthRepositoryInterface
type CommonRepository ¶
type CommonRepository struct { }
func (*CommonRepository) Commit ¶
func (re *CommonRepository) Commit(ctx context.Context, batch *firestore.BulkWriter)
Commit コミットする
type CommonRepositoryInterface ¶
type CommonRepositoryInterface interface {
Commit(ctx context.Context, batch *firestore.BulkWriter)
}
func NewCommonRepository ¶
func NewCommonRepository() CommonRepositoryInterface
type InviteRepository ¶
type InviteRepository struct { }
func (*InviteRepository) Create ¶
func (re *InviteRepository) Create(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, i *model.Invite) error
Create 招待を作成する
func (*InviteRepository) Delete ¶
func (re *InviteRepository) Delete(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, code string) error
Delete アイテムを削除する
func (*InviteRepository) DeleteByUserID ¶
func (re *InviteRepository) DeleteByUserID(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, userID string) error
DeleteByUserID ユーザーIDから削除する
type InviteRepositoryInterface ¶
type InviteRepositoryInterface interface { Create(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, i *model.Invite) error Delete(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, code string) error DeleteByUserID(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, userID string) error Find(ctx context.Context, f *firestore.Client, code string) (*model.Invite, error) FindByUserID(ctx context.Context, f *firestore.Client, userID string) (*model.Invite, error) }
func NewInviteRepository ¶
func NewInviteRepository() InviteRepositoryInterface
type ItemRepository ¶
type ItemRepository struct { }
func (*ItemRepository) Create ¶
func (re *ItemRepository) Create(ctx context.Context, f *firestore.Client, userID string, i *model.Item) error
Create アイテムを作成する
func (*ItemRepository) Delete ¶
func (re *ItemRepository) Delete(ctx context.Context, f *firestore.Client, userID string, i *model.DeleteItem) error
Delete アイテムを削除する
func (*ItemRepository) GetCountUserMultipleInPeriod ¶ added in v1.7.0
func (re *ItemRepository) GetCountUserMultipleInPeriod(ctx context.Context, f *firestore.Client, sip SearchItemParam) (int, error)
GetCountUserMultipleInPeriod 期間でアイテムの総数を取得する
func (*ItemRepository) GetItem ¶
func (re *ItemRepository) GetItem(ctx context.Context, f *firestore.Client, userID string, id string) (*model.Item, error)
GetItem アイテムを取得する
func (*ItemRepository) GetItemUserMultipleInPeriod ¶
func (re *ItemRepository) GetItemUserMultipleInPeriod(ctx context.Context, f *firestore.Client, sip SearchItemParam, first int, cursor ItemsInPeriodCursor) ([]*model.Item, error)
GetItemUserMultipleInPeriod 期間でアイテムを取得する
func (*ItemRepository) GetItemsInDate ¶
func (re *ItemRepository) GetItemsInDate(ctx context.Context, f *firestore.Client, userID string, date time.Time) ([]*model.Item, error)
GetItemsInDate 日付でアイテムを取得する
type ItemRepositoryInterface ¶
type ItemRepositoryInterface interface { Create(ctx context.Context, f *firestore.Client, userID string, i *model.Item) error Update(ctx context.Context, f *firestore.Client, userID string, i *model.UpdateItem, updatedAt time.Time) error Delete(ctx context.Context, f *firestore.Client, userID string, i *model.DeleteItem) error GetItem(ctx context.Context, f *firestore.Client, userID string, id string) (*model.Item, error) GetItemsInDate(ctx context.Context, f *firestore.Client, userID string, date time.Time) ([]*model.Item, error) GetItemsInPeriod(ctx context.Context, f *firestore.Client, userID string, stertDate time.Time, endDate time.Time, first int, cursor ItemsInPeriodCursor) ([]*model.Item, error) GetItemUserMultipleInPeriod(ctx context.Context, f *firestore.Client, sip SearchItemParam, first int, cursor ItemsInPeriodCursor) ([]*model.Item, error) GetCountUserMultipleInPeriod(ctx context.Context, f *firestore.Client, sip SearchItemParam) (int, error) }
func NewItemRepository ¶
func NewItemRepository() ItemRepositoryInterface
type ItemsInPeriodCursor ¶
type PushTokenRepository ¶
type PushTokenRepository struct { }
type PushTokenRepositoryInterface ¶
type PushTokenRepositoryInterface interface { Create(ctx context.Context, f *firestore.Client, userID string, i *model.PushToken) error GetItems(ctx context.Context, f *firestore.Client, userID string) ([]*model.PushToken, error) GetTokens(ctx context.Context, f *firestore.Client, userID string) []string }
func NewPushTokenRepository ¶
func NewPushTokenRepository() PushTokenRepositoryInterface
NewPushTokenRepository is Create new PushTokenRepository
type RelationshipCursor ¶
type RelationshipData ¶
type RelationshipInterface ¶
type RelationshipInterface interface { Create(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, i *model.Relationship) error Delete(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, i *model.Relationship) error FindByFollowedID(ctx context.Context, f *firestore.Client, userID string, first int, cursor RelationshipCursor) ([]*model.Relationship, error) ExistByFollowedID(ctx context.Context, f *firestore.Client, userID string) (bool, error) }
func NewRelationshipRepository ¶
func NewRelationshipRepository() RelationshipInterface
type RelationshipRepository ¶
type RelationshipRepository struct { }
func (*RelationshipRepository) Create ¶
func (re *RelationshipRepository) Create(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, i *model.Relationship) error
Create 作成する
func (*RelationshipRepository) Delete ¶
func (re *RelationshipRepository) Delete(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, i *model.Relationship) error
Delete 削除する
func (*RelationshipRepository) ExistByFollowedID ¶
func (re *RelationshipRepository) ExistByFollowedID(ctx context.Context, f *firestore.Client, userID string) (bool, error)
ExistByFollowedID フォローしているか確認
func (*RelationshipRepository) Find ¶
func (re *RelationshipRepository) Find(ctx context.Context, f *firestore.Client, i *model.Relationship) (*model.Relationship, error)
Find 取得する
func (*RelationshipRepository) FindByFollowedID ¶
func (re *RelationshipRepository) FindByFollowedID(ctx context.Context, f *firestore.Client, userID string, first int, cursor RelationshipCursor) ([]*model.Relationship, error)
FindByFollowedID ページングで取得する
type RelationshipRequestData ¶
type RelationshipRequestInterface ¶
type RelationshipRequestInterface interface { Create(ctx context.Context, f *firestore.Client, i *model.RelationshipRequest) error Update(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, i *model.RelationshipRequest) error DeleteByFollowedID(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, userID string) error DeleteByFollowerID(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, userID string) error Find(ctx context.Context, f *firestore.Client, i *model.RelationshipRequest) (*model.RelationshipRequest, error) FindByFollowedID(ctx context.Context, f *firestore.Client, userID string, first int, cursor RelationshipRequestCursor) ([]*model.RelationshipRequest, error) }
func NewRelationshipRequestRepository ¶
func NewRelationshipRequestRepository() RelationshipRequestInterface
type RelationshipRequestRepository ¶
type RelationshipRequestRepository struct { }
func (*RelationshipRequestRepository) Create ¶
func (re *RelationshipRequestRepository) Create(ctx context.Context, f *firestore.Client, i *model.RelationshipRequest) error
Create 作成する
func (*RelationshipRequestRepository) DeleteByFollowedID ¶
func (re *RelationshipRequestRepository) DeleteByFollowedID(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, userID string) error
DeleteByFollowedID ユーザーIDから削除する
func (*RelationshipRequestRepository) DeleteByFollowerID ¶
func (re *RelationshipRequestRepository) DeleteByFollowerID(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, userID string) error
DeleteByFollowerID ユーザーIDから削除する
func (*RelationshipRequestRepository) Find ¶
func (re *RelationshipRequestRepository) Find(ctx context.Context, f *firestore.Client, i *model.RelationshipRequest) (*model.RelationshipRequest, error)
Find 取得する
func (*RelationshipRequestRepository) FindByFollowedID ¶
func (re *RelationshipRequestRepository) FindByFollowedID(ctx context.Context, f *firestore.Client, userID string, first int, cursor RelationshipRequestCursor) ([]*model.RelationshipRequest, error)
FindByFollowedID ページングで取得する
func (*RelationshipRequestRepository) Update ¶
func (re *RelationshipRequestRepository) Update(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, i *model.RelationshipRequest) error
Update 更新する
type SearchItemParam ¶
type UserRepository ¶
type UserRepository struct { }
func (*UserRepository) Delete ¶
func (re *UserRepository) Delete(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, uid string) error
Delete ユーザーを削除する
func (*UserRepository) ExistByFirebaseUID ¶
func (re *UserRepository) ExistByFirebaseUID(ctx context.Context, f *firestore.Client, fUID string) (bool, error)
ExistByFirebaseUID FirebaseユーザーIDが存在するか取得する
func (*UserRepository) FindByFirebaseUID ¶
func (re *UserRepository) FindByFirebaseUID(ctx context.Context, f *firestore.Client, fUID string) (*model.User, error)
FindByFirebaseUID FirebaseユーザーIDから取得する
func (*UserRepository) FindByUID ¶
func (re *UserRepository) FindByUID(ctx context.Context, f *firestore.Client, uid string) (*model.User, error)
FindByUID ユーザーIDから取得する
func (*UserRepository) FindDatabaseDataByUID ¶
func (re *UserRepository) FindDatabaseDataByUID(ctx context.Context, f *firestore.Client, uid string) (*User, error)
FindDatabaseDataByUID ユーザーIDからデータベースのデータを取得する
func (*UserRepository) FindInUID ¶
func (re *UserRepository) FindInUID(ctx context.Context, f *firestore.Client, uid []string) ([]*model.User, error)
FindInUID ユーザーIDリストから取得する
func (*UserRepository) UpdateFirebaseUID ¶
func (re *UserRepository) UpdateFirebaseUID(ctx context.Context, f *firestore.Client, user *User) error
UpdateFirebaseUID ユーザーFirebaseUIを更新する
type UserRepositoryInterface ¶
type UserRepositoryInterface interface { Create(ctx context.Context, f *firestore.Client, u *model.User) error Update(ctx context.Context, f *firestore.Client, u *model.User) error UpdateFirebaseUID(ctx context.Context, f *firestore.Client, user *User) error Delete(ctx context.Context, f *firestore.Client, tx *firestore.Transaction, uid string) error FindByUID(ctx context.Context, f *firestore.Client, uid string) (*model.User, error) FindDatabaseDataByUID(ctx context.Context, f *firestore.Client, uid string) (*User, error) FindByFirebaseUID(ctx context.Context, f *firestore.Client, fUID string) (*model.User, error) ExistByFirebaseUID(ctx context.Context, f *firestore.Client, fUID string) (bool, error) FindInUID(ctx context.Context, f *firestore.Client, uid []string) ([]*model.User, error) }
func NewUserRepository ¶
func NewUserRepository() UserRepositoryInterface