stats

package
v0.0.0-...-c60ef1b Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package stats holds the statics logic of the go-reminders application

Copyright 2015-2019 VMware, Inc. All Rights Reserved. Author: Tom Hite (thite@vmware.com)

SPDX-License-Identifier: https://spdx.org/licenses/MIT.html

Package stats holds the statics logic of the go-reminders application

Copyright 2015-2019 VMware, Inc. All Rights Reserved. Author: Tom Hite (thite@vmware.com)

SPDX-License-Identifier: https://spdx.org/licenses/MIT.html

Package stats holds the statics logic of the go-reminders application

Copyright 2015-2019 VMware, Inc. All Rights Reserved. Author: Tom Hite (thite@vmware.com)

SPDX-License-Identifier: https://spdx.org/licenses/MIT.html

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HitsFromJSON

func HitsFromJSON(jsonData []byte) (map[string]int, error)

HitsFromJSON convert a JSON string to Go struct and return.

Types

type Stats

type Stats struct {
	Hits map[string]int `json:"hits"`
	// contains filtered or unexported fields
}

Stats store hits per URL

func New

func New() Stats

New initializes and returns a new Stats struct

func (*Stats) AddHit

func (s *Stats) AddHit(request string)

AddHit increses the number of hits count to the reminders API.

func (*Stats) Get

func (s *Stats) Get(w rest.ResponseWriter, r *rest.Request)

Get returns the number of hits count to the reminders API.

Jump to

Keyboard shortcuts

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