Documentation ¶
Index ¶
- Variables
- func ExtractValue(body string, key string) string
- type MockRelationships
- func (mp *MockRelationships) AddRelationship(ctx context.Context, relationship *data.Relationship) error
- func (mp *MockRelationships) CloseDB()
- func (mp *MockRelationships) Connect() error
- func (mp *MockRelationships) DeleteRelationship(ctx context.Context, id string) error
- func (mp *MockRelationships) GetFriendsListByUserID(ctx context.Context, userID string) (*data.DetailedRelationships, error)
- func (mp *MockRelationships) GetInvitesListByUserID(ctx context.Context, userID string) (*data.DetailedRelationships, error)
- func (mp *MockRelationships) GetUserByID(userID string) (*data.DetailedUser, error)
- func (mp *MockRelationships) GetUserDetails(userID string, relations data.Relationships) (*data.DetailedRelationships, error)
- func (mp *MockRelationships) PingDB() error
- func (mp *MockRelationships) UpdateRelationship(ctx context.Context, relationship *data.Relationship) error
- type MongoRelationships
- func (mp *MongoRelationships) AddRelationship(ctx context.Context, relationship *data.Relationship) error
- func (mp *MongoRelationships) CloseDB()
- func (mp *MongoRelationships) Connect() error
- func (mp *MongoRelationships) DeleteRelationship(ctx context.Context, id string) error
- func (mp *MongoRelationships) GetFriendsListByUserID(ctx context.Context, userID string) (*data.DetailedRelationships, error)
- func (mp *MongoRelationships) GetInvitesListByUserID(ctx context.Context, userID string) (*data.DetailedRelationships, error)
- func (mp *MongoRelationships) GetUserByID(userID string) (*data.DetailedUser, error)
- func (mp *MongoRelationships) GetUserDetails(userID string, relations data.Relationships) (*data.DetailedRelationships, error)
- func (mp *MongoRelationships) PingDB() error
- func (mp *MongoRelationships) UpdateRelationship(ctx context.Context, relationship *data.Relationship) error
- type RelationshipDB
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorEnvVar = fmt.Errorf("missing environment variable")
ErrorEnvVar : Environment variable error
Functions ¶
func ExtractValue ¶
extracts the value for a key from a JSON-formatted string body - the JSON-response as a string. Usually retrieved via the request body key - the key for which the value should be extracted returns - the value for the given key
Types ¶
type MockRelationships ¶
type MockRelationships struct { }
func (*MockRelationships) AddRelationship ¶
func (mp *MockRelationships) AddRelationship(ctx context.Context, relationship *data.Relationship) error
func (*MockRelationships) CloseDB ¶
func (mp *MockRelationships) CloseDB()
func (*MockRelationships) Connect ¶
func (mp *MockRelationships) Connect() error
func (*MockRelationships) DeleteRelationship ¶
func (mp *MockRelationships) DeleteRelationship(ctx context.Context, id string) error
func (*MockRelationships) GetFriendsListByUserID ¶
func (mp *MockRelationships) GetFriendsListByUserID(ctx context.Context, userID string) (*data.DetailedRelationships, error)
func (*MockRelationships) GetInvitesListByUserID ¶
func (mp *MockRelationships) GetInvitesListByUserID(ctx context.Context, userID string) (*data.DetailedRelationships, error)
func (*MockRelationships) GetUserByID ¶
func (mp *MockRelationships) GetUserByID(userID string) (*data.DetailedUser, error)
func (*MockRelationships) GetUserDetails ¶
func (mp *MockRelationships) GetUserDetails(userID string, relations data.Relationships) (*data.DetailedRelationships, error)
func (*MockRelationships) PingDB ¶
func (mp *MockRelationships) PingDB() error
func (*MockRelationships) UpdateRelationship ¶
func (mp *MockRelationships) UpdateRelationship(ctx context.Context, relationship *data.Relationship) error
type MongoRelationships ¶
type MongoRelationships struct {
// contains filtered or unexported fields
}
func (*MongoRelationships) AddRelationship ¶
func (mp *MongoRelationships) AddRelationship(ctx context.Context, relationship *data.Relationship) error
func (*MongoRelationships) CloseDB ¶
func (mp *MongoRelationships) CloseDB()
func (*MongoRelationships) Connect ¶
func (mp *MongoRelationships) Connect() error
func (*MongoRelationships) DeleteRelationship ¶
func (mp *MongoRelationships) DeleteRelationship(ctx context.Context, id string) error
func (*MongoRelationships) GetFriendsListByUserID ¶
func (mp *MongoRelationships) GetFriendsListByUserID(ctx context.Context, userID string) (*data.DetailedRelationships, error)
func (*MongoRelationships) GetInvitesListByUserID ¶
func (mp *MongoRelationships) GetInvitesListByUserID(ctx context.Context, userID string) (*data.DetailedRelationships, error)
func (*MongoRelationships) GetUserByID ¶
func (mp *MongoRelationships) GetUserByID(userID string) (*data.DetailedUser, error)
func (*MongoRelationships) GetUserDetails ¶
func (mp *MongoRelationships) GetUserDetails(userID string, relations data.Relationships) (*data.DetailedRelationships, error)
func (*MongoRelationships) PingDB ¶
func (mp *MongoRelationships) PingDB() error
func (*MongoRelationships) UpdateRelationship ¶
func (mp *MongoRelationships) UpdateRelationship(ctx context.Context, relationship *data.Relationship) error
type RelationshipDB ¶
type RelationshipDB interface { GetFriendsListByUserID(ctx context.Context, userID string) (*data.DetailedRelationships, error) GetInvitesListByUserID(ctx context.Context, userID string) (*data.DetailedRelationships, error) UpdateRelationship(ctx context.Context, relationship *data.Relationship) error AddRelationship(ctx context.Context, relationship *data.Relationship) error DeleteRelationship(ctx context.Context, id string) error GetUserDetails(userID string, relations data.Relationships) (*data.DetailedRelationships, error) GetUserByID(userID string) (*data.DetailedUser, error) Connect() error PingDB() error CloseDB() }
The interface that any kind of database must implement
func NewMockRelationships ¶
func NewMockRelationships() RelationshipDB
func NewMongoRelationships ¶
func NewMongoRelationships() RelationshipDB
Click to show internal directories.
Click to hide internal directories.