golane

package module
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2019 License: GPL-3.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Go Report Card

golane

Wrapper for the unofficial azur lane json api in Go

Docs

https://godoc.org/github.com/azurlane-api/golane

Example

package main

import (
	"fmt"
	"github.com/azurlane-api/golane"
)

func main() {
	var azurlane = new(golane.AzurLane)
	azurlane.Init("custom_ua/v0.1.0")

	ships, err := azurlane.GetShips(golane.Order.RARITY, "Super Rare")
	if err != nil {
		fmt.Printf("Something bad happened:\n%s", err.Error())
		return
	}

	for i := 0; i < len(ships); i++ {
		fmt.Printf("[%s]: %s\n", ships[i].ID, ships[i].Name)
	}
}

Support

discord

Documentation

Index

Constants

View Source
const (
	// Version the package version
	Version = "1.3.0"
)

Variables

View Source
var (

	// Category enum of categories
	Category = &category{
		RARITY:      "rarity",
		TYPE:        "type",
		AFFILIATION: "affiliation",
	}
)

Functions

This section is empty.

Types

type AzurLane

type AzurLane struct {
	UserAgent string
	Token     string
}

AzurLane set default settings

func (AzurLane) GetBuildInfo

func (al AzurLane) GetBuildInfo(time string) (*structs.Construction, error)

GetBuildInfo returns info about a certain construction time

func (AzurLane) GetShipByID

func (al AzurLane) GetShipByID(id string) (*structs.Ship, error)

GetShipByID get ship info by id

func (AzurLane) GetShipByName

func (al AzurLane) GetShipByName(name string) (*structs.Ship, error)

GetShipByName get ship info by name

func (AzurLane) GetShips

func (al AzurLane) GetShips(category categoryItem, value string) ([]structs.SmallShip, error)

GetShips returns a list of ships from rarity, type or affiliation order should be set using the "enum" Order, for example Order.TYPE value depends on what order is set too, for example if `Order.RARITY` is used value can be `Super Rare`

func (*AzurLane) Init

func (al *AzurLane) Init(options Options)

Init initialize struct with header options param, use an empty string for UserAgent to use the default value

type Options

type Options struct {
	UserAgent string
	Token     string
}

Options the header options

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL