property

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	View = "View"
	Edit = "Edit"
	Hide = "Hide"
)

Variables

View Source
var ErrInvalidStatus = errors.New("property Status should either be View, Edit, or Hide")
View Source
var ErrPropertyKeyShouldNotBeEmpty = errors.New("property key should not be empty")

Functions

func PropertiesToMap

func PropertiesToMap(props []*Property) map[string]string

Types

type Property

type Property struct {
	ServiceID uuid.UUID `json:"service_id" gorm:"type:uuid;not null;primary_key"`
	// Key represents property for a struct located under exec/services. Example: Port, or Password
	Key string `json:"key" gorm:"not null;primary_key"`
	// Value represents property value for a struct located under exec/services. Example: 80, or SOME_SECURE_PASSWORD
	Value *string `json:"value" gorm:"not null;default:''"`
	// Status is a type of a property that is either View, Edit, or Hide. View allows users to ONLY view the given property. Edit Allows to both View, and Edit the given property, and finally Hide ensures that property is hidden from the competitor's view
	Status string `json:"status,omitempty" gorm:"not null;default:'View'"`
}

Property model describes a single key value pair for a check_service(parameters). An example could be a port for HTTP checking

func (*Property) BeforeCreate

func (p *Property) BeforeCreate(_ *gorm.DB) (err error)

func (*Property) BeforeSave

func (p *Property) BeforeSave(tx *gorm.DB) (err error)

func (Property) TableName

func (Property) TableName() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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