Documentation ¶
Index ¶
- Variables
- func CacheExpires(r *http.Response) time.Time
- func FactionNameToID(faction string) int32
- func GetJournalRefID(referenceName string) int
- func ParseTime(input int64) time.Time
- func TokenFromJSON(jsonStr string) (*oauth2.Token, error)
- func TokenToJSON(token *oauth2.Token) (string, error)
- func ValidCharacterName(name string) bool
- type APIClient
- type EVESSOClaims
- type SSOAuthenticator
- func (c *SSOAuthenticator) AuthorizeURL(state string, onlineAccess bool, scopes []string) string
- func (c *SSOAuthenticator) ChangeAuthURL(authUrl string)
- func (c *SSOAuthenticator) ChangeTokenURL(tokenUrl string)
- func (c *SSOAuthenticator) TokenExchange(code string) (*oauth2.Token, error)
- func (c *SSOAuthenticator) TokenRevoke(refreshToken string) error
- func (c *SSOAuthenticator) TokenSource(token *oauth2.Token) oauth2.TokenSource
- func (c *SSOAuthenticator) Verify(auth oauth2.TokenSource) (*VerifyResponse, error)
- type VerifyResponse
Constants ¶
This section is empty.
Variables ¶
var ( ContextOAuth2 = esi.ContextOAuth2 ContextAccessToken = esi.ContextAccessToken )
ContextOAuth2 is the context for GoESI authentication. Pass a tokenSource with this key to a context for an ESI API Call.
var FactionAllies = map[int32]int32{
500001: 500003,
500003: 500001,
500002: 500004,
500004: 500002,
}
FactionAllies resolves friendly faction war IDs
var FactionsAtWar = map[int32][]int32{
500001: {500002, 500004},
500003: {500002, 500004},
500002: {500001, 500003},
500004: {500001, 500003},
}
FactionsAtWar resolves two enemy parties for each factionID
var FactionsByID = map[int32]string{500001: "Caldari", 500002: "Minmatar", 500003: "Amarr", 500004: "Gallente"}
FactionsByID Factions resolves faction ID to Name
var FactionsByName = map[string]int32{"Caldari": 500001, "Minmatar": 500002, "Amarr": 500003, "Gallente": 500004}
FactionsByName Factions resolves faction name to ID
var JournalRefID = map[string]int{}/* 176 elements not displayed */
JournalRefID Maps journal strings to CCP internal refID. CCP has stated these are subject to change. Please submit pull requests for new IDs
Functions ¶
func CacheExpires ¶
CacheExpires helper function to determine remaining time before repeating a request.
func FactionNameToID ¶
func GetJournalRefID ¶
GetJournalRefID looks up the Journal reference name and returns the internal ID WARNING: These are subject to change per CCP.
func TokenFromJSON ¶
TokenFromJSON helper function to convert stored JSON to a token.
func TokenToJSON ¶
TokenToJSON helper function to convert a token to a storable format.
func ValidCharacterName ¶
ValidCharacterName https://community.eveonline.com/support/policies/naming-policy-en/
Types ¶
type APIClient ¶
APIClient manages communication with the EVE Swagger Interface API In most cases there should be only one, shared, APIClient.
func NewAPIClient ¶
NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.
func (*APIClient) ChangeBasePath ¶
ChangeBasePath allows alternate ESI paths to be used for testing
type EVESSOClaims ¶
type EVESSOClaims struct { Name string `json:"name,omitempty"` Owner string `json:"owner,omitempty"` Scopes []string `json:"scp,omitempty"` ClientID string `json:"azp,omitempty"` Tenant string `json:"tenant,omitempty"` Tier string `json:"tier,omitempty"` Region string `json:"region,omitempty"` jwt.RegisteredClaims }
EVESSOClaims JWT Claims.
type SSOAuthenticator ¶
type SSOAuthenticator struct {
// contains filtered or unexported fields
}
SSOAuthenticator interface for the EVE SSO. SSOAuthenticator [TODO] lose this mutex and allow scopes to change without conflict.
func NewSSOAuthenticator ¶
func (*SSOAuthenticator) AuthorizeURL ¶
func (c *SSOAuthenticator) AuthorizeURL(state string, onlineAccess bool, scopes []string) string
AuthorizeURL returns an url for an end user to authenticate with EVE SSO and return success to the redirectURL. It is important to create a significantly unique state for this request and verify the state matches when returned to the redirectURL.
func (*SSOAuthenticator) ChangeAuthURL ¶
func (c *SSOAuthenticator) ChangeAuthURL(authUrl string)
ChangeAuthURL changes the oauth2 configuration url for authentication
func (*SSOAuthenticator) ChangeTokenURL ¶
func (c *SSOAuthenticator) ChangeTokenURL(tokenUrl string)
ChangeTokenURL changes the oauth2 configuration url for token
func (*SSOAuthenticator) TokenExchange ¶
func (c *SSOAuthenticator) TokenExchange(code string) (*oauth2.Token, error)
TokenExchange exchanges the code returned to the redirectURL for an access token. A caching client must be passed. This client MUST cache per CCP guidelines or face banning.
func (*SSOAuthenticator) TokenRevoke ¶
func (c *SSOAuthenticator) TokenRevoke(refreshToken string) error
TokenRevoke revokes a refresh token
func (*SSOAuthenticator) TokenSource ¶
func (c *SSOAuthenticator) TokenSource(token *oauth2.Token) oauth2.TokenSource
TokenSource creates a refreshable token that can be passed to ESI functions
func (*SSOAuthenticator) Verify ¶
func (c *SSOAuthenticator) Verify(auth oauth2.TokenSource) (*VerifyResponse, error)
Verify the client and collect user information.