Categorygithub.com/bravecollective/neucore-api-go
repositorypackage
0.0.0-20231114205041-18bafbcd23ca
Repository: https://github.com/bravecollective/neucore-api-go.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

The version numbers correspond to the Neucore version numbers.

When updating, check the generator version in .openapi-generator/VERSION, a new version may break backwards compatibility.

Breaking changes

  • 1.43.0
    Player.character_id is now an integer instead of string.

Go API client for neucoreapi

Client library of Neucore API

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 2.4.0
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import neucoreapi "github.com/bravecollective/neucore-api-go"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value sw.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), neucoreapi.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value sw.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), neucoreapi.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using sw.ContextOperationServerIndices and sw.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), neucoreapi.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), neucoreapi.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to https://localhost/api

ClassMethodHTTP requestDescription
ApplicationApiShowV1Get /app/v1/showShow app information.
ApplicationCharactersApiCharacterListV1Post /app/v1/character-listReturns all known characters from the parameter list.
ApplicationCharactersApiCharactersBulkV1Post /app/v1/charactersReturns all characters from multiple player accounts identified by character IDs.
ApplicationCharactersApiCharactersV1Get /app/v1/characters/{characterId}Returns all characters of the player account to which the character ID belongs.
ApplicationCharactersApiCorporationCharactersV1Get /app/v1/corp-characters/{corporationId}Returns a list of all known characters from the corporation.
ApplicationCharactersApiCorporationPlayersV1Get /app/v1/corp-players/{corporationId}Returns a list of all players that have a character in the corporation.
ApplicationCharactersApiIncomingCharactersV1Get /app/v1/incoming-characters/{characterId}Returns all characters that were moved from another account to the player account to which the ID belongs.
ApplicationCharactersApiMainV1Get /app/v1/main/{cid}Returns the main character of the player account to which the character ID belongs.
ApplicationCharactersApiMainV2Get /app/v2/main/{cid}Returns the main character of the player account to which the character ID belongs.
ApplicationCharactersApiPlayerCharactersV1Get /app/v1/player-chars/{playerId}Returns all characters from the player account.
ApplicationCharactersApiPlayerV1Get /app/v1/player/{characterId}Returns the player account to which the character ID belongs.
ApplicationCharactersApiPlayerWithCharactersV1Get /app/v1/player-with-characters/{characterId}Returns the player account to which the character ID belongs with all characters.
ApplicationCharactersApiPlayersV1Post /app/v1/playersReturns player accounts identified by character IDs. Can contain the same player several times.
ApplicationCharactersApiRemovedCharactersV1Get /app/v1/removed-characters/{characterId}Returns all characters that were removed from the player account to which the character ID belongs.
ApplicationESIApiEsiAccessTokenV1Get /app/v1/esi/access-token/{characterId}Returns an access token for a character and EVE login.
ApplicationESIApiEsiEveLoginCharactersV1Get /app/v1/esi/eve-login/{name}/charactersReturns character IDs of characters that have an ESI token (including invalid) of an EVE login.
ApplicationESIApiEsiEveLoginTokenDataV1Get /app/v1/esi/eve-login/{name}/token-dataReturns data for all valid tokens (roles are also checked if applicable) for an EVE login.
ApplicationESIApiEsiPostV1Post /app/v1/esiSee POST /app/v2/esi
ApplicationESIApiEsiPostV2Post /app/v2/esiSame as GET /app/v2/esi, but for POST requests.
ApplicationESIApiEsiV1Get /app/v1/esiSee GET /app/v2/esi
ApplicationESIApiEsiV2Get /app/v2/esiMakes an ESI GET request on behalf on an EVE character and returns the result.
ApplicationGroupsApiAllianceGroupsBulkV1Post /app/v1/alliance-groupsReturn groups of multiple alliances.
ApplicationGroupsApiAllianceGroupsV1Get /app/v1/alliance-groups/{aid}Return groups of the alliance.
ApplicationGroupsApiAllianceGroupsV2Get /app/v2/alliance-groups/{aid}Return groups of the alliance.
ApplicationGroupsApiCorpGroupsBulkV1Post /app/v1/corp-groupsReturn groups of multiple corporations.
ApplicationGroupsApiCorpGroupsV1Get /app/v1/corp-groups/{cid}Return groups of the corporation.
ApplicationGroupsApiCorpGroupsV2Get /app/v2/corp-groups/{cid}Return groups of the corporation.
ApplicationGroupsApiGroupMembersV1Get /app/v1/group-members/{groupId}Returns the main character IDs from all group members.
ApplicationGroupsApiGroupsBulkV1Post /app/v1/groupsReturn groups of multiple players, identified by one of their character IDs.
ApplicationGroupsApiGroupsV1Get /app/v1/groups/{cid}Return groups of the character's player account.
ApplicationGroupsApiGroupsV2Get /app/v2/groups/{cid}Return groups of the character's player account.
ApplicationGroupsApiGroupsWithFallbackV1Get /app/v1/groups-with-fallbackReturns groups from the character's account, if available, or the corporation and alliance.
ApplicationTrackingApiMemberTrackingV1Get /app/v1/corporation/{id}/member-trackingReturn corporation member tracking data.

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

BearerAuth

  • Type: HTTP Bearer token authentication

Example

auth := context.WithValue(context.Background(), sw.ContextAccessToken, "BEARER_TOKEN_STRING")
r, err := client.Service.Operation(auth, args)

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author