hospitality

package
v0.0.0-...-8365721 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheScore

type CacheScore map[string]uint32

CacheScore represents the score on specific cache id

type Hospitality

type Hospitality struct {
	SC map[string]CacheScore `json:"score"`
}

Hospitality represents the score of the host

{
	"score": {
		"l3": {
			"0": 30
			"1": 30
		}
	}
}

func (*Hospitality) GetByRequest

func (h *Hospitality) GetByRequest(req *Request) error

GetByRequest returns hospitality score by request

func (*Hospitality) GetByRequestMaxMin

func (h *Hospitality) GetByRequestMaxMin(max, min uint32, cacheIDuint *uint32, targetLev string) error

GetByRequestMaxMin constructs Hospitality struct by max and min cache ways

type Request

type Request struct {
	MaxCache uint32  `json:"max_cache,omitempty"`
	MinCache uint32  `json:"min_cache,omitempty"`
	Policy   string  `json:"policy,omitempty"`
	CacheID  *uint32 `json:"cache_id,omitempty"`
}

Request represents the hospitality request

Jump to

Keyboard shortcuts

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