Skip to content

Latest commit

 

History

History
96 lines (68 loc) · 2.16 KB

README.md

File metadata and controls

96 lines (68 loc) · 2.16 KB

game-client

GameClient - Go client

A friendly game of Capture the Flag

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: 1.0.0
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://testdouble.com

Installation

Install the following dependencies:

go get -u github.com/danthompson/capture-the-flag-client-go

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

import "github.com/danthompson/capture-the-flag-client-go/game_client"

Getting Started

package main
import (
	"context"
	"fmt"
	game "github.com/danthompson/capture-the-flag-client-go"
)
func main() {
	config := game.NewConfiguration()
	config.Host = "THE_GAME_HOST"
	auth := context.WithValue(
		context.Background(),
		game.ContextAccessToken, "YOUR_BEARER_TOKEN",
	)
	client := game.NewAPIClient(config)
	lineResp, netResp, err := client.GameApi.GetPlayer(auth)
	if err != nil {
		panic(err)
	}
	fmt.Printf("%v", lineResp)
	fmt.Printf("%v", netResp)
}

Documentation for API Endpoints

All URIs are relative to https://GAME-API-ENDPOINT/api

Class Method HTTP request Description
GameApi GetPlayer Get /player Get Player
GameApi PostMoves Post /moves Create Move

Documentation For Models

Documentation For Authorization

Your bearer token is your email address.

token

  • Type: Bearer authentication

Example

auth := context.WithValue(
    context.Background(),
    sw.ContextAccessToken, "YOUR_BEARER_TOKEN"
)

r, err := client.Service.Operation(auth, args)

Author

[email protected]