uuid

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrHttpRequestFailed

type ErrHttpRequestFailed struct {
	StatusCode int
	Body       string
}

Shows the actual status code, as well as the response body. Shows the error instead if it can't read the response body.

func NewErrHttpRequestFailed

func NewErrHttpRequestFailed(status int, resBody io.ReadCloser) *ErrHttpRequestFailed

func (*ErrHttpRequestFailed) Error

func (e *ErrHttpRequestFailed) Error() string

type MojanUUIDToProfileResponse

type MojanUUIDToProfileResponse struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}

type UUIDCache

type UUIDCache struct {
	Items     map[string]UUIDCacheItem
	CacheTime time.Duration
}

func NewUUIDCache

func NewUUIDCache(cacheTime time.Duration) *UUIDCache

Returns a new UUID Cache

func (*UUIDCache) GetNameFromUUID

func (c *UUIDCache) GetNameFromUUID(uuid string) (string, error)

Either return the name from cache or fetch from the server if the name is either not cached or the cache expired.

type UUIDCacheItem

type UUIDCacheItem struct {
	Name      string
	Timestamp time.Time
}

Jump to

Keyboard shortcuts

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