Documentation ¶
Index ¶
Constants ¶
View Source
const ( CollectionName = "dotlan_forum_manager" DatabaseName = "unwindia" DefaultTimeout = 10 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DatabaseClient ¶
type DatabaseClient interface { // Upsert creates or updates an DotlanForumStatus entry Upsert(ctx context.Context, entry *DotlanForumStatus) error // Get returns an existing DotlanForumStatus by the given id. Id is the id of the match within dotlan (tcontest.tcid) Get(ctx context.Context, id string) (*DotlanForumStatus, error) // List returns all existing DotlanForumStatus entries in a Result chan List(ctx context.Context, filter interface{}, resultChan chan Result) }
DatabaseClient is the client-interface for the main mongodb database
type DatabaseClientImpl ¶
type DatabaseClientImpl struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(ctx context.Context, env *environment.Environment) (*DatabaseClientImpl, error)
func NewClientWithDatabase ¶
func (DatabaseClientImpl) Get ¶
func (d DatabaseClientImpl) Get(ctx context.Context, id string) (*DotlanForumStatus, error)
func (DatabaseClientImpl) List ¶
func (d DatabaseClientImpl) List(ctx context.Context, filter interface{}, resultChan chan Result)
func (DatabaseClientImpl) Upsert ¶
func (d DatabaseClientImpl) Upsert(ctx context.Context, entry *DotlanForumStatus) error
type DotlanForumStatus ¶
type DotlanForumStatus struct { ID string `bson:"_id" json:"unwindiaMatchID"` DotlanForumPostID int `bson:"dotlanForumPostID" json:"dotlanForumPostID"` DotlanForumThreadID int `bson:"dotlanForumThreadID" json:"dotlanForumThreadID"` CreatedAt time.Time `bson:"createdAt,omitempty"` UpdatedAt time.Time `bson:"updatedAt,omitempty"` }
type DotlanForumStatusList ¶
type DotlanForumStatusList []DotlanForumStatus
type Result ¶
type Result struct { Result DotlanForumStatusList Error error }
Click to show internal directories.
Click to hide internal directories.