Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AGraphNode ¶
type AGraphNode interface {
// NodeID returns the internal graph node identifier
NodeID() string
}
AGraphNode represents an arbitrary graph node
type ID ¶
type ID string
ID represents a universally unique identifier
func (ID) ImplementsGraphQLType ¶
ImplementsGraphQLType implements the GraphQL scalar type interface
type MutableStore ¶
type MutableStore interface {
CreateSession(
ctx context.Context,
key string,
creationTime time.Time,
email string,
password string,
) (
result Session,
err error,
)
CloseSession(
ctx context.Context,
key string,
) (
result bool,
err error,
)
CloseAllSessions(
ctx context.Context,
user ID,
) (
result []string,
err error,
)
CreatePost(
ctx context.Context,
creationTime time.Time,
author ID,
title string,
contents string,
) (
result Post,
err error,
)
CreateReaction(
ctx context.Context,
creationTime time.Time,
author ID,
subject ID,
emotion emotion.Emotion,
message string,
) (
result Reaction,
err error,
)
CreateUser(
ctx context.Context,
creationTime time.Time,
email string,
displayName string,
passwordHash string,
) (
result User,
err error,
)
EditPost(
ctx context.Context,
post ID,
editor ID,
newTitle *string,
newContents *string,
) (
result Post,
changes struct {
Title bool
Contents bool
},
err error,
)
EditUser(
ctx context.Context,
user ID,
editor ID,
newEmail *string,
newPassword *string,
) (
result User,
changes struct {
Email bool
Password bool
},
err error,
)
EditReaction(
ctx context.Context,
reaction ID,
editor ID,
newMessage string,
) (
result Reaction,
changes struct {
Message bool
},
err error,
)
}
MutableStore interfaces a transactional store
type Post ¶
type Post struct {
GraphNode
ID ID
Creation time.Time
Author *User
Title string
Contents string
Reactions []Reaction
}
Post represents a Post entity
type Reaction ¶
type Reaction struct {
GraphNode
ID ID
Subject AGraphNode
Creation time.Time
Author *User
Message string
Emotion emotion.Emotion
Reactions []Reaction
}
Reaction represents a Reaction entity
type Session ¶
Session represents a Session entity
Source Files
¶
- graphNode.go
- id.go
- post.go
- reaction.go
- session.go
- store.go
- user.go
Click to show internal directories.
Click to hide internal directories.