model

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DocHealthCheck added in v0.2.0

type DocHealthCheck struct {
	Version   string `json:"version"`
	Revision  string `json:"revision"`
	Timestamp int64  `json:"timestamp"`
	Total     int64  `json:"total_kv_count"`
}

DocHealthCheck is response doc

type DocResponseGetKey added in v0.2.0

type DocResponseGetKey struct {
	Data  []*DocResponseSingleKey `json:"data"`
	Total int64                   `json:"total"`
}

DocResponseGetKey is response doc

type DocResponseSingleKey added in v0.2.0

type DocResponseSingleKey struct {
	CreateRevision int64             `json:"create_revision"`
	CreateTime     string            `json:"create_time"`
	ID             string            `json:"id"`
	Key            string            `json:"key"`
	LabelFormat    string            `json:"label_format"`
	Labels         map[string]string `json:"labels"`
	UpdateRevision int64             `json:"update_revision"`
	UpdateTime     string            `json:"update_time"`
	Value          string            `json:"value"`
	ValueType      string            `json:"value_type"`
}

DocResponseSingleKey is response doc

type GetKVRequest added in v0.2.0

type GetKVRequest struct {
	Project string `json:"project,omitempty" yaml:"project,omitempty" validate:"commonName"`
	Domain  string `json:"domain,omitempty" yaml:"domain,omitempty" validate:"commonName"` //redundant
	ID      string `json:"id,omitempty" bson:"id,omitempty" yaml:"id,omitempty" swag:"string" validate:"uuid"`
}

GetKVRequest contains kv get request params

type KVDoc

type KVDoc struct {
	ID             string `json:"id,omitempty" bson:"id,omitempty" yaml:"id,omitempty" swag:"string"`
	LabelFormat    string `json:"label_format,omitempty" bson:"label_format,omitempty" yaml:"label_format,omitempty"`
	Key            string `json:"key" yaml:"key" validate:"key"`
	Value          string `json:"value" yaml:"value" validate:"value"`
	ValueType      string `json:"value_type,omitempty" bson:"value_type,omitempty" yaml:"value_type,omitempty" validate:"valueType"` //ini,json,text,yaml,properties
	Checker        string `json:"check,omitempty" yaml:"check,omitempty" validate:"check"`                                           //python script
	CreateRevision int64  `json:"create_revision,omitempty" bson:"create_revision," yaml:"create_revision,omitempty"`
	UpdateRevision int64  `json:"update_revision,omitempty" bson:"update_revision," yaml:"update_revision,omitempty"`
	Project        string `json:"project,omitempty" yaml:"project,omitempty" validate:"commonName"`
	Status         string `json:"status,omitempty" yaml:"status,omitempty" validate:"kvStatus"`
	CreateTime     int64  `json:"create_time,omitempty" bson:"create_time," yaml:"create_time,omitempty"`
	UpdateTime     int64  `json:"update_time,omitempty" bson:"update_time," yaml:"update_time,omitempty"`

	Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty" validate:"max=6,dive,keys,labelKV,endkeys,labelKV"` //redundant
	Domain string            `json:"domain,omitempty" yaml:"domain,omitempty" validate:"commonName"`                              //redundant
}

KVDoc is database struct to store kv

type KVRequest added in v0.2.0

type KVRequest struct {
	Key       string            `json:"key" yaml:"key"`
	Value     string            `json:"value,omitempty" yaml:"value,omitempty"`
	ValueType string            `json:"value_type,omitempty" bson:"value_type,omitempty" yaml:"value_type,omitempty"` //ini,json,text,yaml,properties
	Checker   string            `json:"check,omitempty" yaml:"check,omitempty"`                                       //python script
	Labels    map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`                                     //redundant
}

KVRequest is http request body

type KVResponse

type KVResponse struct {
	LabelDoc *LabelDocResponse `json:"label,omitempty"`
	Total    int               `json:"total"`
	Data     []*KVDoc          `json:"data"`
}

KVResponse represents the key value list

type LabelDoc

type LabelDoc struct {
	ID      string            `json:"id,omitempty" bson:"id,omitempty" yaml:"id,omitempty" swag:"string"`
	Labels  map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
	Format  string            `bson:"format,omitempty"`
	Domain  string            `json:"domain,omitempty" yaml:"domain,omitempty"` //tenant info
	Project string            `json:"project,omitempty" yaml:"project,omitempty"`
	Alias   string            `json:"alias,omitempty" yaml:"alias,omitempty"`
}

LabelDoc is database struct to store labels

type LabelDocResponse

type LabelDocResponse struct {
	Labels map[string]string `json:"labels,omitempty"`
}

LabelDocResponse is label struct

type LabelHistoryResponse

type LabelHistoryResponse struct {
	Labels   map[string]string `json:"labels,omitempty"`
	KVs      []*KVDoc          `json:"data,omitempty"`
	Revision int               `json:"revision"`
}

LabelHistoryResponse is label history revision struct

type ListKVRequest added in v0.2.0

type ListKVRequest struct {
	Project string            `json:"project,omitempty" yaml:"project,omitempty" validate:"commonName"`
	Domain  string            `json:"domain,omitempty" yaml:"domain,omitempty" validate:"commonName"` //redundant
	Key     string            `json:"key" yaml:"key" validate:"getKey"`
	Labels  map[string]string `json:"labels,omitempty" yaml:"labels,omitempty" validate:"max=8,dive,keys,labelKV,endkeys,labelKV"` //redundant
	Offset  int64             `validate:"min=0"`
	Limit   int64             `validate:"min=0,max=100"`
	Status  string            `json:"status,omitempty" yaml:"status,omitempty" validate:"kvStatus"`
}

ListKVRequest contains kv list request params

type PollingDataResponse added in v0.2.0

type PollingDataResponse struct {
	Data  []*PollingDetail `json:"data"`
	Total int              `json:"total"`
}

PollingDataResponse is response doc

type PollingDetail added in v0.2.0

type PollingDetail struct {
	ID           string                 `json:"id,omitempty" yaml:"id,omitempty"`
	SessionID    string                 `json:"session_id,omitempty" bson:"session_id," yaml:"session_id,omitempty"`
	SessionGroup string                 `json:"session_group,omitempty" bson:"session_group," yaml:"session_group,omitempty"`
	Domain       string                 `json:"domain,omitempty" yaml:"domain,omitempty"`
	PollingData  map[string]interface{} `json:"polling_data,omitempty" yaml:"polling_data,omitempty"`
	Revision     string                 `json:"revision,omitempty" yaml:"revision,omitempty"`
	IP           string                 `json:"ip,omitempty" yaml:"ip,omitempty"`
	UserAgent    string                 `json:"user_agent,omitempty" bson:"user_agent," yaml:"user_agent,omitempty"`
	URLPath      string                 `json:"url_path,omitempty"  bson:"url_path,"  yaml:"url_path,omitempty"`
	ResponseBody []*KVDoc               `json:"kv,omitempty"  bson:"kv,"  yaml:"kv,omitempty"`
	ResponseCode int                    `json:"response_code,omitempty"  bson:"response_code,"  yaml:"response_code,omitempty"`
	Timestamp    time.Time              `json:"timestamp,omitempty" yaml:"timestamp,omitempty"`
}

PollingDetail is db struct, it record operation history

type UpdateKVRequest added in v0.2.0

type UpdateKVRequest struct {
	ID      string `json:"id,omitempty" bson:"id,omitempty" yaml:"id,omitempty" swag:"string" validate:"uuid"`
	Value   string `json:"value,omitempty" yaml:"value,omitempty" validate:"value"`
	Project string `json:"project,omitempty" yaml:"project,omitempty" validate:"commonName"`
	Domain  string `json:"domain,omitempty" yaml:"domain,omitempty" validate:"commonName"` //redundant
	Status  string `json:"status,omitempty" yaml:"status,omitempty" validate:"kvStatus"`
}

UpdateKVRequest is db struct, it contains kv update request params

type ViewDoc added in v0.2.0

type ViewDoc struct {
	ID       string `json:"id,omitempty" bson:"id,omitempty" yaml:"id,omitempty" swag:"string"`
	Display  string `json:"display,omitempty" yaml:"display,omitempty"`
	Project  string `json:"project,omitempty" yaml:"project,omitempty"`
	Domain   string `json:"domain,omitempty" yaml:"domain,omitempty"`
	Criteria string `json:"criteria,omitempty" yaml:"criteria,omitempty"`
}

ViewDoc is db struct, it saves user's custom view name and criteria

type ViewResponse added in v0.2.0

type ViewResponse struct {
	Total int        `json:"total,omitempty"`
	Data  []*ViewDoc `json:"data,omitempty"`
}

ViewResponse represents the view list

Jump to

Keyboard shortcuts

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