graph

package
v1.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(s []string, e string) bool

func GetNestCollectFieldArgumentValue

func GetNestCollectFieldArgumentValue(ctx context.Context, cfs []graphql.CollectedField, columnName string, argumentName string) string

func GetNestCollectFields

func GetNestCollectFields(ctx context.Context, cfs []graphql.CollectedField, columnName string) []graphql.CollectedField

func GrpcErrorStatusCode

func GrpcErrorStatusCode(err error) codes.Code

Types

type Application

type Application struct {
	UserRepository                repository.UserRepositoryInterface
	ItemRepository                repository.ItemRepositoryInterface
	InviteRepository              repository.InviteRepositoryInterface
	RelationshipRequestRepository repository.RelationshipRequestInterface
	RelationshipRepository        repository.RelationshipInterface
	PushTokenRepository           repository.PushTokenRepositoryInterface
	CommonRepository              repository.CommonRepositoryInterface
	AuthRepository                repository.AuthRepositoryInterface

	AuthUseCase auth.UseCase
	TraceClient trace.Tracer
}

func NewApplication

func NewApplication(tr trace.Tracer) *Application

NewApplication アプリケーションを作成する

type Client

type Client struct {
	UUID      uuidgen.UUIDGenerator
	Time      timegen.TimeGenerator
	AuthToken authToken.AuthTokenClient
	Task      task.HTTPTaskInterface
}

type Graph

type Graph struct {
	UserID          string
	FirebaseUID     string
	FirestoreClient *firestore.Client
	App             *Application
	Client          *Client
}

Graph Graph struct

func NewGraph

func NewGraph(ctx context.Context, app *Application, f *firestore.Client) (*Graph, error)

NewGraph Graphを作成

func NewGraphWithSetUserID

func NewGraphWithSetUserID(ctx context.Context, app *Application, f *firestore.Client, uid, fuid string) *Graph

NewGraphWithSetUserID Graphを作成(ログイン前)

func (*Graph) AcceptRelationshipRequest

func (g *Graph) AcceptRelationshipRequest(ctx context.Context, followedID string) (*model.RelationshipRequest, error)

AcceptRelationshipRequest 招待リクエストを承諾する

func (*Graph) CreateAuthUser

func (g *Graph) CreateAuthUser(ctx context.Context, input *model.NewAuthUser) (*model.AuthUser, error)

CreateAuthUser 認証済みユーザーを作成

func (*Graph) CreateInvite

func (g *Graph) CreateInvite(ctx context.Context) (*model.Invite, error)

CreateInvite 招待を作成する

func (*Graph) CreateItem

func (g *Graph) CreateItem(ctx context.Context, input *model.NewItem) (*model.Item, error)

CreateItem アイテム作成

func (*Graph) CreatePushToken

func (g *Graph) CreatePushToken(ctx context.Context, input *model.NewPushToken) (*model.PushToken, error)

PushToken トークン作成

func (*Graph) CreateRelationshipRequest

func (g *Graph) CreateRelationshipRequest(ctx context.Context, input model.NewRelationshipRequest) (*model.RelationshipRequest, error)

CreateRelationshipRequest 共有の招待リクエストを作成する

func (*Graph) CreateUser

func (g *Graph) CreateUser(ctx context.Context, input *model.NewUser) (*model.User, error)

CreateUser ユーザー作成

func (*Graph) DeleteItem

func (g *Graph) DeleteItem(ctx context.Context, input *model.DeleteItem) (*model.Item, error)

DeleteItem アイテム削除

func (*Graph) DeleteRelationship

func (g *Graph) DeleteRelationship(ctx context.Context, followedID string) (*model.Relationship, error)

DeleteRelationship 共有ユーザーを解除する

func (*Graph) DeleteUser

func (g *Graph) DeleteUser(ctx context.Context) (*model.User, error)

DeleteUser ユーザーを削除

func (*Graph) ExistAuthUser

func (g *Graph) ExistAuthUser(ctx context.Context) (*model.ExistAuthUser, error)

ExistAuthUser 認証ユーザーが存在するか判定する

func (*Graph) GetInviteByCode

func (g *Graph) GetInviteByCode(ctx context.Context, code string) (*model.User, error)

GetInviteByCode コードから招待を取得する

func (*Graph) GetInviteByUseID

func (g *Graph) GetInviteByUseID(ctx context.Context) (*model.Invite, error)

GetInviteByUseID ユーザーIDから招待を取得する

func (*Graph) GetItem

func (g *Graph) GetItem(ctx context.Context, id string) (*model.Item, error)

GetItem アイテム取得

func (*Graph) GetItemsInDate

func (g *Graph) GetItemsInDate(ctx context.Context, date time.Time) ([]*model.Item, error)

GetItemsInDate 日付でアイテムを取得

func (*Graph) GetItemsInPeriod

func (g *Graph) GetItemsInPeriod(ctx context.Context, input model.InputItemsInPeriod) (*model.ItemsInPeriod, error)

GetItemsInPeriod 期間でアイテムを取得

func (*Graph) GetRelationshipRequests

func (g *Graph) GetRelationshipRequests(ctx context.Context, input model.InputRelationshipRequests, userSkip bool) (*model.RelationshipRequests, error)

GetRelationshipRequests 共有の招待リクエストを取得する

func (*Graph) GetRelationships

func (g *Graph) GetRelationships(ctx context.Context, input model.InputRelationships, userSkip bool) (*model.Relationships, error)

GetRelationships 共有ユーザーを取得する

func (*Graph) GetUser

func (g *Graph) GetUser(ctx context.Context) (*model.User, error)

GetUser ユーザー取得

func (*Graph) NgRelationshipRequest

func (g *Graph) NgRelationshipRequest(ctx context.Context, followedID string) (*model.RelationshipRequest, error)

ngRelationshipRequest 招待リクエストを拒否する

func (*Graph) UpdateInvite

func (g *Graph) UpdateInvite(ctx context.Context) (*model.Invite, error)

UpdateInvite 招待を更新する

func (*Graph) UpdateItem

func (g *Graph) UpdateItem(ctx context.Context, input *model.UpdateItem) (*model.Item, error)

UpdateItem アイテム更新

func (*Graph) UpdateUser

func (g *Graph) UpdateUser(ctx context.Context, input *model.UpdateUser) (*model.User, error)

UpdateUser ユーザーを更新

type Resolver

type Resolver struct {
	FirestoreClient *firestore.Client
	App             *Application
}

Resolver Resolver type

func (*Resolver) Mutation

func (r *Resolver) Mutation() generated.MutationResolver

Mutation returns generated.MutationResolver implementation.

func (*Resolver) Query

func (r *Resolver) Query() generated.QueryResolver

Query returns generated.QueryResolver implementation.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL