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 ¶
- type Cache
- func (c *Cache) BulkGetProfileId(names []string) ([]*entity.ProfileId, error)
- func (c *Cache) Close() error
- func (c *Cache) GetBlacklist() (*entity.Blacklist, error)
- func (c *Cache) GetNameHistory(id uuid.UUID) (*entity.NameChangeHistory, error)
- func (c *Cache) GetProfile(id uuid.UUID) (*entity.Profile, error)
- func (c *Cache) GetProfileId(name string, at time.Time) (*entity.ProfileId, error)
- func (c *Cache) GetRateLimitAllocation() uint64
- func (c *Cache) Login(displayName string, serverId string, ip string) (*entity.Profile, error)
- func (c *Cache) NewListener() *Listener
- func (c *Cache) PurgeBlacklist() error
- func (c *Cache) PurgeNameHistory(id uuid.UUID) error
- func (c *Cache) PurgeProfile(id uuid.UUID) error
- func (c *Cache) PurgeProfileId(name string, at time.Time) error
- type Listener
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
provides an abstraction layer between callers, the caching system and the upstream API
func New ¶
func New(upstream *mojang.MojangAPI, storage storage.StorageBackend) *Cache
creates a new cache client using
func (*Cache) BulkGetProfileId ¶
resolves multiple profile associations at the current time
func (*Cache) GetBlacklist ¶
retrieves the current server blacklist
func (*Cache) GetNameHistory ¶
retrieves the name history of a given profile
func (*Cache) GetProfile ¶
retrieves a single profile
func (*Cache) GetProfileId ¶
retrieves the profile to which a given display name has been assigned at a specific time
func (*Cache) GetRateLimitAllocation ¶
retrieves the amount of requests which have been submitted to the upstream servers within the last minute
func (*Cache) NewListener ¶
registers a new event listener with the cache
func (*Cache) PurgeBlacklist ¶
func (*Cache) PurgeNameHistory ¶
purges a name history from the cache
func (*Cache) PurgeProfile ¶
purges a specific profile from the cache