smt

package
v0.0.0-...-18f703b Latest Latest
Warning

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

Go to latest
Published: May 2, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler implements topology operations

func NewHandler

func NewHandler(repo Repository) *Handler

NewHandler returns a new topology Handler

func (*Handler) Get

func (h *Handler) Get(response http.ResponseWriter, request *http.Request)

Get HTTP GET handler which returns the data-plane topology

func (*Handler) Save

func (h *Handler) Save(response http.ResponseWriter, request *http.Request)

Save HTTP POST handler which stores the data-plane topology

type Property

type Property struct {
	ID          primitive.ObjectID `json:"id" bson:"_id"`
	Title       string             `json:"title" bson:"title"`
	Description string             `json:"description" bson:"description"`
	Text        string             `json:"text" bson:"text"`
}

Property struct contains information about the properties to be verified

type Repository

type Repository interface {
	// FindAll returns all the packets from storage
	FindAll() ([]Property, error)
	// Store stores a new packet
	Store(p Property) error
	// Update updates a property
	Update(t Property) error
	// Count counts the properties objects stored
	Count() (int64, error)
}

Repository defines the methods to be implemented by the storage layer.

func NewRepository

func NewRepository(c *mongo.Client) Repository

NewRepository returns a new mongo Repository

Jump to

Keyboard shortcuts

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