weights

package
v1.14.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: Apache-2.0, Apache-2.0 Imports: 14 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)

Create request handler creates a new weight resource

func Delete

func Delete(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)

Delete weights resource based on ID

func HandleSubrouter

func HandleSubrouter(s *mux.Router, confhandler *respond.ConfHandler)

HandleSubrouter uses the subrouter for a specific calls and creates a tree of sorts handling each route with a different subrouter

func List

func List(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)

List the existing weight resources for the tenant making the request

func ListOne

func ListOne(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)

ListOne handles the listing of one weight resource based on its given id

func Options

func Options(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)

Options request handler

func Update

func Update(r *http.Request, cfg config.Config) (int, http.Header, []byte, error)

Update function to update contents of an existing weights resource

Types

type Links struct {
	Self string `json:"self"`
}

Links struct to hold links

type SelfReference

type SelfReference struct {
	ID    string `json:"id" bson:"id,omitempty"`
	Links Links  `json:"links"`
}

SelfReference to hold links and id

type Weight

type Weight struct {
	Name  string  `bson:"name" json:"name"`
	Value float64 `bson:"value" json:"value"`
}

Weight hols a mapping between group name and weight value

type Weights

type Weights struct {
	ID         string   `bson:"id" json:"id"`
	DateInt    int      `bson:"date_integer" json:"-"`
	Date       string   `bson:"date" json:"date"`
	Name       string   `bson:"name" json:"name"`
	WeightType string   `bson:"weight_type" json:"weight_type"`
	GroupType  string   `bson:"group_type" json:"group_type"`
	Groups     []Weight `bson:"groups" json:"groups"`
}

Weights holds a list of group weights of specific type and of specific group type

Jump to

Keyboard shortcuts

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