topsecretsplit

package
v0.0.0-...-ee2f979 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package topsecretsplit provee los dto de comunicación entre los satélites y el servicio topsecret_split

Package topsecretsplit provee los dto de comunicación entre los satélites y el servicio topsecret_split

Package topsecretsplit provee los dto de comunicación entre los satélites y el servicio topsecret_split

Index

Constants

This section is empty.

Variables

View Source
var Cache = cache.New(30*time.Minute, 30*time.Minute)

Cache exporta la instancia de cache

View Source
var Validate *validator.Validate

Validate usado para validar la estructura del payload del request

Functions

func GetTopSecretSplit

func GetTopSecretSplit() (x, y float32, message string, err error)

GetTopSecretSplit obtiene la posicion y mensaje ocultos de los satelites guardados en cache input: request con la distancia al emisor tal cual se recibe en cada satélite output: las coordenadas ‘x’ e ‘y’ del emisor del mensaje

func PostTopSecretSplit

func PostTopSecretSplit(name string, sat Satellite) error

PostTopSecretSplit Crea la llave de uno de los satellites válidos aun no creado

func SetCache

func SetCache(key string, sat Satellite) bool

SetCache setea el valor de una key

Types

type Position

type Position struct {
	X json.Number `json:"x" validate:"required"`
	Y json.Number `json:"y" validate:"required"`
}

Position dto

type Satellite

type Satellite struct {
	Distance float32  `json:"distance" validate:"required"`
	Message  []string `json:"message" validate:"required"`
}

Satellite dto

func GetCache

func GetCache(key string) (Satellite, bool)

GetCache obtiene el valor de una key

type SatelliteResponse

type SatelliteResponse struct {
	Position Position `json:"position"`
	Message  string   `json:"message"`
}

SatelliteResponse dto

Jump to

Keyboard shortcuts

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