Documentation
¶
Index ¶
- Variables
- func InitAsCommandLineAdminUser(ctx context.Context, db *db.DB, userID string) error
- type AllianceIconSize
- type Character
- type CorpIconSize
- type ESI
- func (e *ESI) DoesCharacterNeedRescope(c context.Context, charID int32) (bool, error)
- func (e *ESI) GetCharactersForUser(c context.Context, userID string) ([]Character, error)
- func (e *ESI) GetEvePublicKeys(c context.Context) (*esi.OAuthKeysMetadata, error)
- func (e *ESI) GetEveToken(c context.Context, charID int32) (*esi.Tokens, error)
- func (e *ESI) GoPeriodicallyFetchEvePublicKeys(m *async.Messenger)
- func (e *ESI) GoPeriodicallyRefreshAllTokens(m *async.Messenger)
- func (e *ESI) HasCharacterForUser(c context.Context, userID string, charID int32) (bool, error)
- func (e *ESI) SearchCorporations(c context.Context, query string, lang language.Tag) ([]*esi.Corporation, error)
- func (e *ESI) SetEveTokens(c context.Context, userID string, t *esi.Tokens) error
- type Features
- func (f *Features) ChangeEnabled(ctx context.Context, enableIDs, disableIDs []string) error
- func (f *Features) DiffChangeEnabled(ctx context.Context, enableIDs, disableIDs []string) (added, removed []features.Scope, err error)
- func (f *Features) GetAdminCEOInitialFeatures(ctx context.Context, langs ...language.Tag) ([]features.Feature, error)
- func (f *Features) GetAllFeatures(ctx context.Context, langs ...language.Tag) ([]features.Feature, error)
- func (f *Features) GetByIDs(ctx context.Context, ids []string, langs ...language.Tag) ([]features.Feature, error)
- func (f *Features) GetEnabledFeatures(ctx context.Context, langs ...language.Tag) ([]features.Feature, error)
- type GetEveMediaFn
- type LatestTag
- type Media
- func (m *Media) CreateMedia(c context.Context, name, contentType string, b []byte) (id string, err error)
- func (m *Media) DeleteMedia(c context.Context, id string) error
- func (m *Media) GetAllianceIcon(c context.Context, aID int32, size AllianceIconSize) (image.Image, error)
- func (m *Media) GetCorporationIcon(c context.Context, corpID int32, size CorpIconSize) (image.Image, error)
- func (m *Media) GetMedia(c context.Context, id string) (name, contentType string, b []byte, err error)
- func (m *Media) GetPortrait(c context.Context, charID int32, size PortraitMediaSize) (image.Image, error)
- type PortraitMediaSize
- type Posts
- type Privileges
- type SetEveMediaFn
- type State
- type Tags
- type Threads
- type Users
Constants ¶
This section is empty.
Variables ¶
var (
NotCEOError = errors.New("cannot choose corp: user is not CEO")
)
Functions ¶
Types ¶
type AllianceIconSize ¶
type AllianceIconSize string
const ( A64 AllianceIconSize = "alliance64" A128 AllianceIconSize = "alliance128" )
func (AllianceIconSize) Apply ¶
func (a AllianceIconSize) Apply(u *esi.AllianceIconURLs) *url.URL
func (AllianceIconSize) GetEveMediaFn ¶
func (a AllianceIconSize) GetEveMediaFn(d *db.DB) GetEveMediaFn
func (AllianceIconSize) SetEveMediaFn ¶
func (a AllianceIconSize) SetEveMediaFn(d *db.DB) SetEveMediaFn
type CorpIconSize ¶
type CorpIconSize string
const ( C64 CorpIconSize = "corp64" C128 CorpIconSize = "corp128" C256 CorpIconSize = "corp256" )
func (CorpIconSize) Apply ¶
func (c CorpIconSize) Apply(u *esi.CorpIconURLs) *url.URL
func (CorpIconSize) GetEveMediaFn ¶
func (c CorpIconSize) GetEveMediaFn(d *db.DB) GetEveMediaFn
func (CorpIconSize) SetEveMediaFn ¶
func (c CorpIconSize) SetEveMediaFn(d *db.DB) SetEveMediaFn
type ESI ¶
type ESI struct { DB *db.DB OAC *esi.OAuth2Client L *zerolog.Logger ESIClient *esi.Client PeriodicRefresh time.Duration PeriodicKeyFetch time.Duration }
func (*ESI) DoesCharacterNeedRescope ¶
func (*ESI) GetCharactersForUser ¶
func (*ESI) GetEvePublicKeys ¶
func (*ESI) GetEveToken ¶
func (*ESI) GoPeriodicallyFetchEvePublicKeys ¶
func (*ESI) GoPeriodicallyRefreshAllTokens ¶
func (*ESI) HasCharacterForUser ¶
func (*ESI) SearchCorporations ¶
type Features ¶
func (*Features) ChangeEnabled ¶
TODO: Call this
func (*Features) DiffChangeEnabled ¶
func (f *Features) DiffChangeEnabled(ctx context.Context, enableIDs, disableIDs []string) (added, removed []features.Scope, err error)
TODO: Call this after selecting different features, before calling ChangeEnabled.
func (*Features) GetAdminCEOInitialFeatures ¶
func (*Features) GetAllFeatures ¶
func (f *Features) GetAllFeatures(ctx context.Context, langs ...language.Tag) ([]features.Feature, error)
TODO: Call this
type GetEveMediaFn ¶
type Media ¶
func (*Media) CreateMedia ¶
func (*Media) GetAllianceIcon ¶
func (*Media) GetCorporationIcon ¶
func (*Media) GetPortrait ¶
type PortraitMediaSize ¶
type PortraitMediaSize string
const ( P64 PortraitMediaSize = "portrait64" P128 PortraitMediaSize = "portrait128" P256 PortraitMediaSize = "portrait256" P512 PortraitMediaSize = "portrait512" )
func (PortraitMediaSize) Apply ¶
func (p PortraitMediaSize) Apply(u *esi.PortraitURLs) *url.URL
func (PortraitMediaSize) GetEveMediaFn ¶
func (p PortraitMediaSize) GetEveMediaFn(d *db.DB) GetEveMediaFn
func (PortraitMediaSize) SetEveMediaFn ¶
func (p PortraitMediaSize) SetEveMediaFn(d *db.DB) SetEveMediaFn
type Privileges ¶
type Privileges struct{}
func DefaultPrivileges ¶
func DefaultPrivileges() Privileges
type State ¶
type State struct {
// contains filtered or unexported fields
}
State solely manages the state of the dharma application in the face of complexity.
The complexity arises because the problem space is:
- There are X accounts on dharma, a subset of which are admin,
- There are numerous EVE Online character(s) associated with accounts on dharma,
- There is exactly one CEO (EVE Online character) of the corporation using dharma,
- Optionally, there is an executor corporation of an alliance, where an alliance is a collection of one or more alliances
- Finally, while not a game mechanic, there is the concept of coalitions which already are effecively alliances that federate for a common cause
In the spirit of decentralized leadership, it simplifies the problem space by enforcing the following constraints to simplify software administration and push power downwards:
- A dharma account with no characters or only non-CEO characters does not enable management of any corporation.
- Dharma manages ONE and ONLY one corporation.
- A dharma administrative account, paired with an EVE Online character that is a CEO, makes that CEO's corporation "eligible" to be managed by dharma
- Corporations managed by dharma, that are also in alliances, have automatic federating behaviors that occur but only towards peer software managing corporations that are also in the same alliance.
- Dharma does nothing special for coalitions, these are covered by the existing ad-hoc federation controls and states.
Note that #0 and #2 imply that there can be many administrative accounts in dharma, but only one of which requires a CEO EVE Online character. This ensures that the in-game CEO always has the maximum tools necessary to administrate dharma, yet retains the option to delegate devops to others.
func (*State) ChooseCorporation ¶
func (*State) RequiresCorpToBeManaged ¶
RequiresCorpToBeManaged determines if the current state requires an admin account to log in with a CEO character to manage that corporation.
func (*State) ShouldCorpReceiveAllianceData ¶
ShouldCorpReceiveAllianceData determines if the current state requires the corporation to receive alliance-level data from peers automatically.
func (*State) ShouldCorpSendAllianceData ¶
ShouldCorpSendAllianceData determines if the current state requires the corporation to send alliance-level data to peers automatically.