package
4.3.12+incompatible
Repository: https://github.com/marcelorube/khan.git
Documentation: pkg.go.dev
# Functions
ApproveOrDenyMembershipApplication sets Membership.Approved to true or Membership.Denied to true.
ApproveOrDenyMembershipInvitation sets Membership.Approved to true or Membership.Denied to true.
CreateClan creates a new clan.
CreateGame creates a new game.
CreateHook returns a newly created event hook.
CreateHookFactory is responsible for creating a test hook instance with the associated game.
CreateMembership creates a new membership.
CreatePlayer creates a new player.
CreatePlayerFactory is responsible for creating a test player instance with the associated game.
DeleteMembership soft deletes a membership.
GetAllClans returns a list of all clans in a given game.
GetAllGames returns all games in the DB.
GetAllHooks returns all the available hooks.
GetClanAndOwnerByPublicID returns the clan as well as the owner of a clan by clan's public id.
GetClanByID returns a clan by id.
GetClanByPublicID returns a clan by its public id.
GetClanByPublicIDAndOwnerPublicID returns a clan by its public id and the owner public id.
GetClanByShortPublicID returns a clan by the beginning of its public id.
GetClanDetails returns all details for a given clan by its game id and public id.
GetClanFromJSON unmarshals the clan from the specified JSON.
GetClanMembers gets only the ids of then clan members.
GetClanReachedMaxMemberships returns a clan with one approved membership, one unapproved membership and game MaxMembers=1.
GetClansByPublicIDs returns clans by their public ids.
GetClansSummaries returns a summary of the clans details for a given list of clans by their game id and public ids.
GetClanSummary returns a summary of the clan details for a given clan by its game id and public id.
GetClanWithMemberships returns a clan filled with the number of memberships specified.
GetDB returns a DbMap connection to the database specified in the arguments.
GetDefaultDB returns a connection to the default database.
GetDeletedMembershipByClanAndPlayerID returns a deleted membership for the player with the given ID and the clan ID.
GetGameByID returns a game by id.
GetGameByPublicID returns a game by their public id.
GetHookByDetails returns a hook by its details (GameID, EventType and Hook URL) If no hook is found returns nil.
GetHookByID returns a hook by id.
GetHookByPublicID returns a hook by game id and public id.
GetHooksForRoutes gets hooks for all the specified routes.
GetLevelByLevelInt returns the level string given the level int.
GetLevelIntByLevel returns the level string given the level int.
GetMembershipByClanAndPlayerPublicID returns a deleted membership for the clan and the player with the given publicIDs.
GetMembershipByID returns a membership by id.
GetNumberOfPendingInvites gets total number of pending invites for player.
GetOldestMemberWithHighestLevel returns the member with highest level that has the oldest creation date.
GetPerfDB returns a connection to the perf database.
GetPlayerByID returns a player by id.
GetPlayerByPublicID returns a player by their public id.
GetPlayerDetails returns detailed information about a player and their memberships.
GetPlayerMembershipDetails returns detailed information about a player and their memberships.
GetPlayerOwnershipDetails returns detailed information about a player owned clans.
GetTestClans returns a list of clans for tests.
GetTestClanWithName returns a clan with name for tests.
GetTestClanWithRandomPublicIDAndName returns a clan with random UUID v4 publicID and name for tests.
GetTestClanWithStaleData returns a player with approved, rejected and banned memberships.
GetTestHooks return a fixed number of hooks for each event available.
GetTestPlayerWithMemberships returns a player with approved, rejected and banned memberships.
GetValidMembershipByClanAndPlayerPublicID returns a non deleted membership for the clan and the player with the given publicIDs.
InitDb initializes a connection to the database.
IsValidOrder returns whether the input is equal to Newest or Oldest.
LeaveClan allows the clan owner to leave the clan and transfer the clan ownership to the next player in line.
NewDefaultGetClanDetailsOptions returns a new options structure with default values for GetClanDetails().
NewESWorker creates and returns a new elasticsearch worker.
NewMongoWorker creates and returns a new mongo worker.
PromoteOrDemoteMember increments or decrements Membership.LevelInt by one.
PruneStaleData off of Khan's database.
RemoveHook removes a hook by public ID.
SearchClan returns a list of clans for a given term (by name or publicID).
TransferClanOwnership allows the clan owner to transfer the clan ownership to a clan member.
UpdateClan updates an existing clan.
UpdateClanMembershipCount updates the clan membership count.
UpdateGame updates an existing game.
UpdatePlayer updates an existing player.
UpdatePlayerMembershipCount updates the player membership count.
UpdatePlayerOwnershipCount updates the player ownership count.
# Constants
ClanCreatedHook happens when a clan is created.
ClanLeftHook happens when a clan owner rage quits.
ClanOwnershipTransferredHook happens when a clan owner transfers ownership to another player.
ClanUpdatedHook happens when a clan is updated.
GameUpdatedHook happens when a game is updated.
MaxPendingApplicationsKey is string constant.
MaxPendingInvitesKey is string constant.
MembershipApplicationCreatedHook happens when a new application or invite to a clan is created.
MembershipApprovedHook happens when a clan membership is approved.
MembershipDemotedHook happens when a clan member is demoted.
MembershipDeniedHook happens when a clan membership is denied.
MembershipLeftHook happens when a player leaves a clan.
MembershipPromotedHook happens when a clan member is promoted.
Newest is the constant "newest".
Oldest is the constant "oldest".
PendingApplicationsOrderKey is string constant.
PendingInvitesOrderKey is string constant.
PlayerCreatedHook happens when a new player is created.
PlayerUpdatedHook happens when a player is updated.
# Variables
ClanFactory is responsible for constructing test clan instances.
GameFactory is responsible for constructing test game instances.
HookFactory is responsible for constructing event hook instances.
MembershipFactory is responsible for constructing test membership instances.
PlayerFactory is responsible for constructing test player instances.
# Structs
AlreadyHasValidMembershipError identifies that a player already has a valid membership for the given clan.
CannotApproveOrDenyMembershipAlreadyProcessedError identifies that a membership that is already processed cannot be approved or denied.
CannotPromoteOrDemoteInvalidMemberError identifies that a given player is not allowed to promote/demote a member.
CannotPromoteOrDemoteMemberLevelError identifies that a given member is already max level and cannot be promoted.
Clan identifies uniquely one clan in a given gameeasyjson:json.
ClanHasNoMembersError identifies that a clan has no members.
ClanReachedMaxMembersError identifies that a given clan already reached the max number of members allowed.
ClanWithNamePrefixes extends Clan with a field to help name indexation in MongoDB.
CouldNotFindAllClansError identifies that one or more of the requested clans do not exist.
EmptyGameIDError identifies that a request was made for a model without the proper game id.
EmptySearchTermError identifies that a search term was not provided.
ESWorker is the worker that will update elasticsearch.
ForbiddenError identifies that an action over an actionable is forbidden given PlayerId.
Game identifies uniquely one game.
GetClanDetailsOptions holds options to change the output of GetClanDetails().
Hook identifies a webhook for a given event.
InvalidCastToGorpSQLExecutorError identifies that cast to gorp.SqlExecutor failed.
InvalidLevelForGameError identifies that a given level is not valid for the given game.
InvalidMembershipActionError identifies that a given action is not valid.
Membership relates a player to a clan.
ModelNotFoundError identifies that a given model was not found in the Database with the given ID.
MongoWorker is the worker that will update mongo.
MustWaitMembershipCooldownError identifies that one must wait a number of seconds before creating the membership.
Player identifies uniquely one player in a given game.
PlayerCannotCreateMembershipError identifies that a given player is not allowed to create a membership.
PlayerCannotPerformMembershipActionError identifies that a given player is not allowed to promote/demote another member.
PlayerReachedMaxClansError identifies that a given player already reached the max number of clans allowed.
PlayerReachedMaxInvitesError identifies that a given player already reached the max number of pending invites allowed.
PruneOptions has all the prunable memberships TTL.
PruneStats show stats about what has been pruned.
# Interfaces
DB is the contract for all the operations we use from either a connection or transaction This is required for automatic transactions.
# Type aliases
ClanByName allows sorting clans by name.