client

package
v1.0.0-SNAPSHOT...-0150756 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

* Copyright 2018 Johannes Donath <johannesd@torchmind.com> * and other copyright owners as documented in the project's IP log. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

* Copyright 2018 Johannes Donath <johannesd@torchmind.com> * and other copyright owners as documented in the project's IP log. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

* Copyright 2018 Johannes Donath <johannesd@torchmind.com> * and other copyright owners as documented in the project's IP log. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

* Copyright 2018 Johannes Donath <johannesd@torchmind.com> * and other copyright owners as documented in the project's IP log. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

* Copyright 2018 Johannes Donath <johannesd@torchmind.com> * and other copyright owners as documented in the project's IP log. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorFunc

type ErrorFunc = func(error)

provides an alias for a function which's sole purpose is to respond to error cases in async functions

type Stockpile

type Stockpile struct {
	Logger *log.Logger
	// contains filtered or unexported fields
}

func New

func New(address string) (*Stockpile, error)

creates a new client for the specified server address

func (*Stockpile) BulkGetProfileId

func (s *Stockpile) BulkGetProfileId(names []string) ([]*entity.ProfileId, error)

queries the server for the player profiles which are currently associated to the given names

func (*Stockpile) CheckBlacklist

func (s *Stockpile) CheckBlacklist(addresses []string) ([]string, error)

asks a server to verify whether one or more of the given addresses have been blacklisted only matching addresses will be returned, when the list is empty, none matched

func (*Stockpile) Close

func (s *Stockpile) Close() error

closes the connection to the remote server

func (*Stockpile) EventChannel

func (s *Stockpile) EventChannel(errorHandler ErrorFunc) (chan *entity.Event, error)

creates an event channel which will be notified about cache events as they occur

func (*Stockpile) GetBlacklist

func (s *Stockpile) GetBlacklist() (*entity.Blacklist, error)

queries a server for the full server blacklist

func (*Stockpile) GetNameHistory

func (s *Stockpile) GetNameHistory(id uuid.UUID) (*entity.NameChangeHistory, error)

queries the server for the complete name history of a given profile

func (*Stockpile) GetPluginList

func (s *Stockpile) GetPluginList() ([]*plugin.Metadata, error)

queries a server for its loaded plugins

func (*Stockpile) GetProfile

func (s *Stockpile) GetProfile(id uuid.UUID) (*entity.Profile, error)

queries the server for a given profile

func (*Stockpile) GetProfileId

func (s *Stockpile) GetProfileId(name string, at time.Time) (*entity.ProfileId, error)

queries a server for the player profile which has been associated to a given name at a specific time

func (*Stockpile) GetStatus

func (s *Stockpile) GetStatus() (*entity.Status, error)

queries a server for its status

func (*Stockpile) Login

func (s *Stockpile) Login(displayName string, serverId string, ip string) (*entity.Profile, error)

performs a cache assisted login an empty string may be passed to the ip field to omit the ip check

Jump to

Keyboard shortcuts

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