models

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2018 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const RemoteNodeRegion string = "remote"

Variables

View Source
var AgentNodeView = &agentNodeViewType{
	s: parse.StructInfo{Type: "AgentNode", SQLSchema: "", SQLName: "agent_nodes", Fields: []parse.FieldInfo{{Name: "AgentID", Type: "int32", Column: "agent_id"}, {Name: "NodeID", Type: "int32", Column: "node_id"}}, PKFieldIndex: -1},
	z: new(AgentNode).Values(),
}

AgentNodeView represents agent_nodes view or table in SQL database.

View Source
var AgentServiceView = &agentServiceViewType{
	s: parse.StructInfo{Type: "AgentService", SQLSchema: "", SQLName: "agent_services", Fields: []parse.FieldInfo{{Name: "AgentID", Type: "int32", Column: "agent_id"}, {Name: "ServiceID", Type: "int32", Column: "service_id"}}, PKFieldIndex: -1},
	z: new(AgentService).Values(),
}

AgentServiceView represents agent_services view or table in SQL database.

View Source
var AgentTable = &agentTableType{
	s: parse.StructInfo{Type: "Agent", SQLSchema: "", SQLName: "agents", Fields: []parse.FieldInfo{{Name: "ID", Type: "int32", Column: "id"}, {Name: "Type", Type: "AgentType", Column: "type"}, {Name: "RunsOnNodeID", Type: "int32", Column: "runs_on_node_id"}, {Name: "ListenPort", Type: "*uint16", Column: "listen_port"}}, PKFieldIndex: 0},
	z: new(Agent).Values(),
}

AgentTable represents agents view or table in SQL database.

View Source
var MySQLServiceTable = &mySQLServiceTableType{
	s: parse.StructInfo{Type: "MySQLService", SQLSchema: "", SQLName: "services", Fields: []parse.FieldInfo{{Name: "ID", Type: "int32", Column: "id"}, {Name: "Type", Type: "ServiceType", Column: "type"}, {Name: "NodeID", Type: "int32", Column: "node_id"}, {Name: "Address", Type: "*string", Column: "address"}, {Name: "Port", Type: "*uint16", Column: "port"}, {Name: "Engine", Type: "*string", Column: "engine"}, {Name: "EngineVersion", Type: "*string", Column: "engine_version"}}, PKFieldIndex: 0},
	z: new(MySQLService).Values(),
}

MySQLServiceTable represents services view or table in SQL database.

View Source
var MySQLdExporterTable = &mySQLdExporterTableType{
	s: parse.StructInfo{Type: "MySQLdExporter", SQLSchema: "", SQLName: "agents", Fields: []parse.FieldInfo{{Name: "ID", Type: "int32", Column: "id"}, {Name: "Type", Type: "AgentType", Column: "type"}, {Name: "RunsOnNodeID", Type: "int32", Column: "runs_on_node_id"}, {Name: "ServiceUsername", Type: "*string", Column: "service_username"}, {Name: "ServicePassword", Type: "*string", Column: "service_password"}, {Name: "ListenPort", Type: "*uint16", Column: "listen_port"}, {Name: "MySQLDisableTablestats", Type: "*bool", Column: "mysql_disable_tablestats"}}, PKFieldIndex: 0},
	z: new(MySQLdExporter).Values(),
}

MySQLdExporterTable represents agents view or table in SQL database.

View Source
var NodeTable = &nodeTableType{
	s: parse.StructInfo{Type: "Node", SQLSchema: "", SQLName: "nodes", Fields: []parse.FieldInfo{{Name: "ID", Type: "int32", Column: "id"}, {Name: "Type", Type: "NodeType", Column: "type"}, {Name: "Name", Type: "string", Column: "name"}}, PKFieldIndex: 0},
	z: new(Node).Values(),
}

NodeTable represents nodes view or table in SQL database.

View Source
var PostgreSQLServiceTable = &postgreSQLServiceTableType{
	s: parse.StructInfo{Type: "PostgreSQLService", SQLSchema: "", SQLName: "services", Fields: []parse.FieldInfo{{Name: "ID", Type: "int32", Column: "id"}, {Name: "Type", Type: "ServiceType", Column: "type"}, {Name: "NodeID", Type: "int32", Column: "node_id"}, {Name: "Address", Type: "*string", Column: "address"}, {Name: "Port", Type: "*uint16", Column: "port"}, {Name: "Engine", Type: "*string", Column: "engine"}, {Name: "EngineVersion", Type: "*string", Column: "engine_version"}}, PKFieldIndex: 0},
	z: new(PostgreSQLService).Values(),
}

PostgreSQLServiceTable represents services view or table in SQL database.

View Source
var PostgresExporterTable = &postgresExporterTableType{
	s: parse.StructInfo{Type: "PostgresExporter", SQLSchema: "", SQLName: "agents", Fields: []parse.FieldInfo{{Name: "ID", Type: "int32", Column: "id"}, {Name: "Type", Type: "AgentType", Column: "type"}, {Name: "RunsOnNodeID", Type: "int32", Column: "runs_on_node_id"}, {Name: "ServiceUsername", Type: "*string", Column: "service_username"}, {Name: "ServicePassword", Type: "*string", Column: "service_password"}, {Name: "ListenPort", Type: "*uint16", Column: "listen_port"}}, PKFieldIndex: 0},
	z: new(PostgresExporter).Values(),
}

PostgresExporterTable represents agents view or table in SQL database.

View Source
var QanAgentTable = &qanAgentTableType{
	s: parse.StructInfo{Type: "QanAgent", SQLSchema: "", SQLName: "agents", Fields: []parse.FieldInfo{{Name: "ID", Type: "int32", Column: "id"}, {Name: "Type", Type: "AgentType", Column: "type"}, {Name: "RunsOnNodeID", Type: "int32", Column: "runs_on_node_id"}, {Name: "ServiceUsername", Type: "*string", Column: "service_username"}, {Name: "ServicePassword", Type: "*string", Column: "service_password"}, {Name: "ListenPort", Type: "*uint16", Column: "listen_port"}, {Name: "QANDBInstanceUUID", Type: "*string", Column: "qan_db_instance_uuid"}}, PKFieldIndex: 0},
	z: new(QanAgent).Values(),
}

QanAgentTable represents agents view or table in SQL database.

View Source
var RDSExporterTable = &rDSExporterTableType{
	s: parse.StructInfo{Type: "RDSExporter", SQLSchema: "", SQLName: "agents", Fields: []parse.FieldInfo{{Name: "ID", Type: "int32", Column: "id"}, {Name: "Type", Type: "AgentType", Column: "type"}, {Name: "RunsOnNodeID", Type: "int32", Column: "runs_on_node_id"}, {Name: "ListenPort", Type: "*uint16", Column: "listen_port"}}, PKFieldIndex: 0},
	z: new(RDSExporter).Values(),
}

RDSExporterTable represents agents view or table in SQL database.

View Source
var RDSNodeTable = &rDSNodeTableType{
	s: parse.StructInfo{Type: "RDSNode", SQLSchema: "", SQLName: "nodes", Fields: []parse.FieldInfo{{Name: "ID", Type: "int32", Column: "id"}, {Name: "Type", Type: "NodeType", Column: "type"}, {Name: "Name", Type: "string", Column: "name"}, {Name: "Region", Type: "string", Column: "region"}}, PKFieldIndex: 0},
	z: new(RDSNode).Values(),
}

RDSNodeTable represents nodes view or table in SQL database.

View Source
var RDSServiceTable = &rDSServiceTableType{
	s: parse.StructInfo{Type: "RDSService", SQLSchema: "", SQLName: "services", Fields: []parse.FieldInfo{{Name: "ID", Type: "int32", Column: "id"}, {Name: "Type", Type: "ServiceType", Column: "type"}, {Name: "NodeID", Type: "int32", Column: "node_id"}, {Name: "AWSAccessKey", Type: "*string", Column: "aws_access_key"}, {Name: "AWSSecretKey", Type: "*string", Column: "aws_secret_key"}, {Name: "Address", Type: "*string", Column: "address"}, {Name: "Port", Type: "*uint16", Column: "port"}, {Name: "Engine", Type: "*string", Column: "engine"}, {Name: "EngineVersion", Type: "*string", Column: "engine_version"}}, PKFieldIndex: 0},
	z: new(RDSService).Values(),
}

RDSServiceTable represents services view or table in SQL database.

View Source
var RemoteNodeTable = &remoteNodeTableType{
	s: parse.StructInfo{Type: "RemoteNode", SQLSchema: "", SQLName: "nodes", Fields: []parse.FieldInfo{{Name: "ID", Type: "int32", Column: "id"}, {Name: "Type", Type: "NodeType", Column: "type"}, {Name: "Name", Type: "string", Column: "name"}, {Name: "Region", Type: "string", Column: "region"}}, PKFieldIndex: 0},
	z: new(RemoteNode).Values(),
}

RemoteNodeTable represents nodes view or table in SQL database.

View Source
var RemoteServiceTable = &remoteServiceTableType{
	s: parse.StructInfo{Type: "RemoteService", SQLSchema: "", SQLName: "services", Fields: []parse.FieldInfo{{Name: "ID", Type: "int32", Column: "id"}, {Name: "Type", Type: "ServiceType", Column: "type"}, {Name: "NodeID", Type: "int32", Column: "node_id"}, {Name: "Address", Type: "*string", Column: "address"}, {Name: "Port", Type: "*uint16", Column: "port"}, {Name: "Engine", Type: "*string", Column: "engine"}, {Name: "EngineVersion", Type: "*string", Column: "engine_version"}}, PKFieldIndex: 0},
	z: new(RemoteService).Values(),
}

RemoteServiceTable represents services view or table in SQL database.

View Source
var ServiceTable = &serviceTableType{
	s: parse.StructInfo{Type: "Service", SQLSchema: "", SQLName: "services", Fields: []parse.FieldInfo{{Name: "ID", Type: "int32", Column: "id"}, {Name: "Type", Type: "ServiceType", Column: "type"}, {Name: "NodeID", Type: "int32", Column: "node_id"}}, PKFieldIndex: 0},
	z: new(Service).Values(),
}

ServiceTable represents services view or table in SQL database.

Functions

func NameForSupervisor added in v1.16.0

func NameForSupervisor(typ AgentType, listenPort uint16) string

NameForSupervisor returns a name of agent for supervisor.

func OpenDB

func OpenDB(name, username, password string, logf reform.Printf) (*sql.DB, error)

Types

type Agent

type Agent struct {
	ID           int32     `reform:"id,pk"`
	Type         AgentType `reform:"type"`
	RunsOnNodeID int32     `reform:"runs_on_node_id"`

	// TODO Does it really belong there? Remove when we have agent without one.
	ListenPort *uint16 `reform:"listen_port"`
}

func AgentsForNodeID

func AgentsForNodeID(q *reform.Querier, nodeID int32) ([]Agent, error)

AgentsForNodeID returns agents providing insights for a given node.

func AgentsForServiceID

func AgentsForServiceID(q *reform.Querier, serviceID int32) ([]Agent, error)

AgentsForServiceID returns agents providing insights for a given service.

func (*Agent) HasPK

func (s *Agent) HasPK() bool

HasPK returns true if record has non-zero primary key set, false otherwise.

func (*Agent) PKPointer

func (s *Agent) PKPointer() interface{}

PKPointer returns a pointer to primary key field for that record. Returned interface{} value is never untyped nil.

func (*Agent) PKValue

func (s *Agent) PKValue() interface{}

PKValue returns a value of primary key for that record. Returned interface{} value is never untyped nil.

func (*Agent) Pointers

func (s *Agent) Pointers() []interface{}

Pointers returns a slice of pointers to struct or record fields. Returned interface{} values are never untyped nils.

func (*Agent) SetPK

func (s *Agent) SetPK(pk interface{})

SetPK sets record primary key.

func (Agent) String

func (s Agent) String() string

String returns a string representation of this struct or record.

func (*Agent) Table

func (s *Agent) Table() reform.Table

Table returns Table object for that record.

func (*Agent) Values

func (s *Agent) Values() []interface{}

Values returns a slice of struct or record field values. Returned interface{} values are never untyped nils.

func (*Agent) View

func (s *Agent) View() reform.View

View returns View object for that struct.

type AgentNode

type AgentNode struct {
	AgentID int32 `reform:"agent_id"`
	NodeID  int32 `reform:"node_id"`
}

func (*AgentNode) Pointers

func (s *AgentNode) Pointers() []interface{}

Pointers returns a slice of pointers to struct or record fields. Returned interface{} values are never untyped nils.

func (AgentNode) String

func (s AgentNode) String() string

String returns a string representation of this struct or record.

func (*AgentNode) Values

func (s *AgentNode) Values() []interface{}

Values returns a slice of struct or record field values. Returned interface{} values are never untyped nils.

func (*AgentNode) View

func (s *AgentNode) View() reform.View

View returns View object for that struct.

type AgentService

type AgentService struct {
	AgentID   int32 `reform:"agent_id"`
	ServiceID int32 `reform:"service_id"`
}

func (*AgentService) Pointers

func (s *AgentService) Pointers() []interface{}

Pointers returns a slice of pointers to struct or record fields. Returned interface{} values are never untyped nils.

func (AgentService) String

func (s AgentService) String() string

String returns a string representation of this struct or record.

func (*AgentService) Values

func (s *AgentService) Values() []interface{}

Values returns a slice of struct or record field values. Returned interface{} values are never untyped nils.

func (*AgentService) View

func (s *AgentService) View() reform.View

View returns View object for that struct.

type AgentType

type AgentType string
const (
	MySQLdExporterAgentType   AgentType = "mysqld_exporter"
	PostgresExporterAgentType AgentType = "postgres_exporter"
	RDSExporterAgentType      AgentType = "rds_exporter"
	QanAgentAgentType         AgentType = "qan-agent"
)

AgentType agent types for exporters and agents

type MySQLService added in v1.16.0

type MySQLService struct {
	ID     int32       `reform:"id,pk"`
	Type   ServiceType `reform:"type"`
	NodeID int32       `reform:"node_id"`

	Address       *string `reform:"address"`
	Port          *uint16 `reform:"port"`
	Engine        *string `reform:"engine"`
	EngineVersion *string `reform:"engine_version"`
}

func (*MySQLService) HasPK added in v1.16.0

func (s *MySQLService) HasPK() bool

HasPK returns true if record has non-zero primary key set, false otherwise.

func (*MySQLService) PKPointer added in v1.16.0

func (s *MySQLService) PKPointer() interface{}

PKPointer returns a pointer to primary key field for that record. Returned interface{} value is never untyped nil.

func (*MySQLService) PKValue added in v1.16.0

func (s *MySQLService) PKValue() interface{}

PKValue returns a value of primary key for that record. Returned interface{} value is never untyped nil.

func (*MySQLService) Pointers added in v1.16.0

func (s *MySQLService) Pointers() []interface{}

Pointers returns a slice of pointers to struct or record fields. Returned interface{} values are never untyped nils.

func (*MySQLService) SetPK added in v1.16.0

func (s *MySQLService) SetPK(pk interface{})

SetPK sets record primary key.

func (MySQLService) String added in v1.16.0

func (s MySQLService) String() string

String returns a string representation of this struct or record.

func (*MySQLService) Table added in v1.16.0

func (s *MySQLService) Table() reform.Table

Table returns Table object for that record.

func (*MySQLService) Values added in v1.16.0

func (s *MySQLService) Values() []interface{}

Values returns a slice of struct or record field values. Returned interface{} values are never untyped nils.

func (*MySQLService) View added in v1.16.0

func (s *MySQLService) View() reform.View

View returns View object for that struct.

type MySQLdExporter

type MySQLdExporter struct {
	ID           int32     `reform:"id,pk"`
	Type         AgentType `reform:"type"`
	RunsOnNodeID int32     `reform:"runs_on_node_id"`

	ServiceUsername        *string `reform:"service_username"`
	ServicePassword        *string `reform:"service_password"`
	ListenPort             *uint16 `reform:"listen_port"`
	MySQLDisableTablestats *bool   `reform:"mysql_disable_tablestats"`
}

func (*MySQLdExporter) DSN

func (m *MySQLdExporter) DSN(service *MySQLService) string

func (*MySQLdExporter) HasPK

func (s *MySQLdExporter) HasPK() bool

HasPK returns true if record has non-zero primary key set, false otherwise.

func (*MySQLdExporter) PKPointer

func (s *MySQLdExporter) PKPointer() interface{}

PKPointer returns a pointer to primary key field for that record. Returned interface{} value is never untyped nil.

func (*MySQLdExporter) PKValue

func (s *MySQLdExporter) PKValue() interface{}

PKValue returns a value of primary key for that record. Returned interface{} value is never untyped nil.

func (*MySQLdExporter) Pointers

func (s *MySQLdExporter) Pointers() []interface{}

Pointers returns a slice of pointers to struct or record fields. Returned interface{} values are never untyped nils.

func (*MySQLdExporter) SetPK

func (s *MySQLdExporter) SetPK(pk interface{})

SetPK sets record primary key.

func (MySQLdExporter) String

func (s MySQLdExporter) String() string

String returns a string representation of this struct or record.

func (*MySQLdExporter) Table

func (s *MySQLdExporter) Table() reform.Table

Table returns Table object for that record.

func (*MySQLdExporter) Values

func (s *MySQLdExporter) Values() []interface{}

Values returns a slice of struct or record field values. Returned interface{} values are never untyped nils.

func (*MySQLdExporter) View

func (s *MySQLdExporter) View() reform.View

View returns View object for that struct.

type Node

type Node struct {
	ID   int32    `reform:"id,pk"`
	Type NodeType `reform:"type"`
	Name string   `reform:"name"`
}

func (*Node) HasPK

func (s *Node) HasPK() bool

HasPK returns true if record has non-zero primary key set, false otherwise.

func (*Node) PKPointer

func (s *Node) PKPointer() interface{}

PKPointer returns a pointer to primary key field for that record. Returned interface{} value is never untyped nil.

func (*Node) PKValue

func (s *Node) PKValue() interface{}

PKValue returns a value of primary key for that record. Returned interface{} value is never untyped nil.

func (*Node) Pointers

func (s *Node) Pointers() []interface{}

Pointers returns a slice of pointers to struct or record fields. Returned interface{} values are never untyped nils.

func (*Node) SetPK

func (s *Node) SetPK(pk interface{})

SetPK sets record primary key.

func (Node) String

func (s Node) String() string

String returns a string representation of this struct or record.

func (*Node) Table

func (s *Node) Table() reform.Table

Table returns Table object for that record.

func (*Node) Values

func (s *Node) Values() []interface{}

Values returns a slice of struct or record field values. Returned interface{} values are never untyped nils.

func (*Node) View

func (s *Node) View() reform.View

View returns View object for that struct.

type NodeType

type NodeType string
const (
	PMMServerNodeType NodeType = "pmm-server"
	RDSNodeType       NodeType = "rds"
	RemoteNodeType    NodeType = "remote"
)

Node types

type PostgreSQLService added in v1.16.0

type PostgreSQLService struct {
	ID     int32       `reform:"id,pk"`
	Type   ServiceType `reform:"type"`
	NodeID int32       `reform:"node_id"`

	Address       *string `reform:"address"`
	Port          *uint16 `reform:"port"`
	Engine        *string `reform:"engine"`
	EngineVersion *string `reform:"engine_version"`
}

func (*PostgreSQLService) HasPK added in v1.16.0

func (s *PostgreSQLService) HasPK() bool

HasPK returns true if record has non-zero primary key set, false otherwise.

func (*PostgreSQLService) PKPointer added in v1.16.0

func (s *PostgreSQLService) PKPointer() interface{}

PKPointer returns a pointer to primary key field for that record. Returned interface{} value is never untyped nil.

func (*PostgreSQLService) PKValue added in v1.16.0

func (s *PostgreSQLService) PKValue() interface{}

PKValue returns a value of primary key for that record. Returned interface{} value is never untyped nil.

func (*PostgreSQLService) Pointers added in v1.16.0

func (s *PostgreSQLService) Pointers() []interface{}

Pointers returns a slice of pointers to struct or record fields. Returned interface{} values are never untyped nils.

func (*PostgreSQLService) SetPK added in v1.16.0

func (s *PostgreSQLService) SetPK(pk interface{})

SetPK sets record primary key.

func (PostgreSQLService) String added in v1.16.0

func (s PostgreSQLService) String() string

String returns a string representation of this struct or record.

func (*PostgreSQLService) Table added in v1.16.0

func (s *PostgreSQLService) Table() reform.Table

Table returns Table object for that record.

func (*PostgreSQLService) Values added in v1.16.0

func (s *PostgreSQLService) Values() []interface{}

Values returns a slice of struct or record field values. Returned interface{} values are never untyped nils.

func (*PostgreSQLService) View added in v1.16.0

func (s *PostgreSQLService) View() reform.View

View returns View object for that struct.

type PostgresExporter added in v1.16.0

type PostgresExporter struct {
	ID           int32     `reform:"id,pk"`
	Type         AgentType `reform:"type"`
	RunsOnNodeID int32     `reform:"runs_on_node_id"`

	ServiceUsername *string `reform:"service_username"`
	ServicePassword *string `reform:"service_password"`
	ListenPort      *uint16 `reform:"listen_port"`
}

PostgresExporter exports PostgreSQL metrics.

func (*PostgresExporter) DSN added in v1.16.0

func (p *PostgresExporter) DSN(service *PostgreSQLService) string

DSN returns DSN for PostgreSQL service.

func (*PostgresExporter) HasPK added in v1.16.0

func (s *PostgresExporter) HasPK() bool

HasPK returns true if record has non-zero primary key set, false otherwise.

func (*PostgresExporter) PKPointer added in v1.16.0

func (s *PostgresExporter) PKPointer() interface{}

PKPointer returns a pointer to primary key field for that record. Returned interface{} value is never untyped nil.

func (*PostgresExporter) PKValue added in v1.16.0

func (s *PostgresExporter) PKValue() interface{}

PKValue returns a value of primary key for that record. Returned interface{} value is never untyped nil.

func (*PostgresExporter) Pointers added in v1.16.0

func (s *PostgresExporter) Pointers() []interface{}

Pointers returns a slice of pointers to struct or record fields. Returned interface{} values are never untyped nils.

func (*PostgresExporter) SetPK added in v1.16.0

func (s *PostgresExporter) SetPK(pk interface{})

SetPK sets record primary key.

func (PostgresExporter) String added in v1.16.0

func (s PostgresExporter) String() string

String returns a string representation of this struct or record.

func (*PostgresExporter) Table added in v1.16.0

func (s *PostgresExporter) Table() reform.Table

Table returns Table object for that record.

func (*PostgresExporter) Values added in v1.16.0

func (s *PostgresExporter) Values() []interface{}

Values returns a slice of struct or record field values. Returned interface{} values are never untyped nils.

func (*PostgresExporter) View added in v1.16.0

func (s *PostgresExporter) View() reform.View

View returns View object for that struct.

type QanAgent

type QanAgent struct {
	ID           int32     `reform:"id,pk"`
	Type         AgentType `reform:"type"`
	RunsOnNodeID int32     `reform:"runs_on_node_id"`

	ServiceUsername   *string `reform:"service_username"`
	ServicePassword   *string `reform:"service_password"`
	ListenPort        *uint16 `reform:"listen_port"`
	QANDBInstanceUUID *string `reform:"qan_db_instance_uuid"` // MySQL instance UUID in QAN
}

func (*QanAgent) DSN

func (q *QanAgent) DSN(service *MySQLService) string

func (*QanAgent) HasPK

func (s *QanAgent) HasPK() bool

HasPK returns true if record has non-zero primary key set, false otherwise.

func (*QanAgent) PKPointer

func (s *QanAgent) PKPointer() interface{}

PKPointer returns a pointer to primary key field for that record. Returned interface{} value is never untyped nil.

func (*QanAgent) PKValue

func (s *QanAgent) PKValue() interface{}

PKValue returns a value of primary key for that record. Returned interface{} value is never untyped nil.

func (*QanAgent) Pointers

func (s *QanAgent) Pointers() []interface{}

Pointers returns a slice of pointers to struct or record fields. Returned interface{} values are never untyped nils.

func (*QanAgent) SetPK

func (s *QanAgent) SetPK(pk interface{})

SetPK sets record primary key.

func (QanAgent) String

func (s QanAgent) String() string

String returns a string representation of this struct or record.

func (*QanAgent) Table

func (s *QanAgent) Table() reform.Table

Table returns Table object for that record.

func (*QanAgent) Values

func (s *QanAgent) Values() []interface{}

Values returns a slice of struct or record field values. Returned interface{} values are never untyped nils.

func (*QanAgent) View

func (s *QanAgent) View() reform.View

View returns View object for that struct.

type RDSExporter added in v1.6.0

type RDSExporter struct {
	ID           int32     `reform:"id,pk"`
	Type         AgentType `reform:"type"`
	RunsOnNodeID int32     `reform:"runs_on_node_id"`

	ListenPort *uint16 `reform:"listen_port"`
}

func (*RDSExporter) HasPK added in v1.6.0

func (s *RDSExporter) HasPK() bool

HasPK returns true if record has non-zero primary key set, false otherwise.

func (*RDSExporter) PKPointer added in v1.6.0

func (s *RDSExporter) PKPointer() interface{}

PKPointer returns a pointer to primary key field for that record. Returned interface{} value is never untyped nil.

func (*RDSExporter) PKValue added in v1.6.0

func (s *RDSExporter) PKValue() interface{}

PKValue returns a value of primary key for that record. Returned interface{} value is never untyped nil.

func (*RDSExporter) Pointers added in v1.6.0

func (s *RDSExporter) Pointers() []interface{}

Pointers returns a slice of pointers to struct or record fields. Returned interface{} values are never untyped nils.

func (*RDSExporter) SetPK added in v1.6.0

func (s *RDSExporter) SetPK(pk interface{})

SetPK sets record primary key.

func (RDSExporter) String added in v1.6.0

func (s RDSExporter) String() string

String returns a string representation of this struct or record.

func (*RDSExporter) Table added in v1.6.0

func (s *RDSExporter) Table() reform.Table

Table returns Table object for that record.

func (*RDSExporter) Values added in v1.6.0

func (s *RDSExporter) Values() []interface{}

Values returns a slice of struct or record field values. Returned interface{} values are never untyped nils.

func (*RDSExporter) View added in v1.6.0

func (s *RDSExporter) View() reform.View

View returns View object for that struct.

type RDSNode

type RDSNode struct {
	ID   int32    `reform:"id,pk"`
	Type NodeType `reform:"type"`
	Name string   `reform:"name"` // DBInstanceIdentifier

	Region string `reform:"region"` // not a pointer, see database structure
}

func (*RDSNode) HasPK

func (s *RDSNode) HasPK() bool

HasPK returns true if record has non-zero primary key set, false otherwise.

func (*RDSNode) PKPointer

func (s *RDSNode) PKPointer() interface{}

PKPointer returns a pointer to primary key field for that record. Returned interface{} value is never untyped nil.

func (*RDSNode) PKValue

func (s *RDSNode) PKValue() interface{}

PKValue returns a value of primary key for that record. Returned interface{} value is never untyped nil.

func (*RDSNode) Pointers

func (s *RDSNode) Pointers() []interface{}

Pointers returns a slice of pointers to struct or record fields. Returned interface{} values are never untyped nils.

func (*RDSNode) SetPK

func (s *RDSNode) SetPK(pk interface{})

SetPK sets record primary key.

func (RDSNode) String

func (s RDSNode) String() string

String returns a string representation of this struct or record.

func (*RDSNode) Table

func (s *RDSNode) Table() reform.Table

Table returns Table object for that record.

func (*RDSNode) Values

func (s *RDSNode) Values() []interface{}

Values returns a slice of struct or record field values. Returned interface{} values are never untyped nils.

func (*RDSNode) View

func (s *RDSNode) View() reform.View

View returns View object for that struct.

type RDSService

type RDSService struct {
	ID     int32       `reform:"id,pk"`
	Type   ServiceType `reform:"type"`
	NodeID int32       `reform:"node_id"`

	AWSAccessKey  *string `reform:"aws_access_key"` // may be nil
	AWSSecretKey  *string `reform:"aws_secret_key"` // may be nil
	Address       *string `reform:"address"`
	Port          *uint16 `reform:"port"`
	Engine        *string `reform:"engine"`
	EngineVersion *string `reform:"engine_version"`
}

func (*RDSService) HasPK

func (s *RDSService) HasPK() bool

HasPK returns true if record has non-zero primary key set, false otherwise.

func (*RDSService) PKPointer

func (s *RDSService) PKPointer() interface{}

PKPointer returns a pointer to primary key field for that record. Returned interface{} value is never untyped nil.

func (*RDSService) PKValue

func (s *RDSService) PKValue() interface{}

PKValue returns a value of primary key for that record. Returned interface{} value is never untyped nil.

func (*RDSService) Pointers

func (s *RDSService) Pointers() []interface{}

Pointers returns a slice of pointers to struct or record fields. Returned interface{} values are never untyped nils.

func (*RDSService) SetPK

func (s *RDSService) SetPK(pk interface{})

SetPK sets record primary key.

func (RDSService) String

func (s RDSService) String() string

String returns a string representation of this struct or record.

func (*RDSService) Table

func (s *RDSService) Table() reform.Table

Table returns Table object for that record.

func (*RDSService) Values

func (s *RDSService) Values() []interface{}

Values returns a slice of struct or record field values. Returned interface{} values are never untyped nils.

func (*RDSService) View

func (s *RDSService) View() reform.View

View returns View object for that struct.

type RemoteNode added in v1.16.0

type RemoteNode struct {
	ID   int32    `reform:"id,pk"`
	Type NodeType `reform:"type"`
	Name string   `reform:"name"` // DBInstanceIdentifier

	Region string `reform:"region"` // not a pointer, see database structure
}

func (*RemoteNode) HasPK added in v1.16.0

func (s *RemoteNode) HasPK() bool

HasPK returns true if record has non-zero primary key set, false otherwise.

func (*RemoteNode) PKPointer added in v1.16.0

func (s *RemoteNode) PKPointer() interface{}

PKPointer returns a pointer to primary key field for that record. Returned interface{} value is never untyped nil.

func (*RemoteNode) PKValue added in v1.16.0

func (s *RemoteNode) PKValue() interface{}

PKValue returns a value of primary key for that record. Returned interface{} value is never untyped nil.

func (*RemoteNode) Pointers added in v1.16.0

func (s *RemoteNode) Pointers() []interface{}

Pointers returns a slice of pointers to struct or record fields. Returned interface{} values are never untyped nils.

func (*RemoteNode) SetPK added in v1.16.0

func (s *RemoteNode) SetPK(pk interface{})

SetPK sets record primary key.

func (RemoteNode) String added in v1.16.0

func (s RemoteNode) String() string

String returns a string representation of this struct or record.

func (*RemoteNode) Table added in v1.16.0

func (s *RemoteNode) Table() reform.Table

Table returns Table object for that record.

func (*RemoteNode) Values added in v1.16.0

func (s *RemoteNode) Values() []interface{}

Values returns a slice of struct or record field values. Returned interface{} values are never untyped nils.

func (*RemoteNode) View added in v1.16.0

func (s *RemoteNode) View() reform.View

View returns View object for that struct.

type RemoteService added in v1.16.0

type RemoteService struct {
	ID     int32       `reform:"id,pk"`
	Type   ServiceType `reform:"type"`
	NodeID int32       `reform:"node_id"`

	Address       *string `reform:"address"`
	Port          *uint16 `reform:"port"`
	Engine        *string `reform:"engine"`
	EngineVersion *string `reform:"engine_version"`
}

func (*RemoteService) HasPK added in v1.16.0

func (s *RemoteService) HasPK() bool

HasPK returns true if record has non-zero primary key set, false otherwise.

func (*RemoteService) PKPointer added in v1.16.0

func (s *RemoteService) PKPointer() interface{}

PKPointer returns a pointer to primary key field for that record. Returned interface{} value is never untyped nil.

func (*RemoteService) PKValue added in v1.16.0

func (s *RemoteService) PKValue() interface{}

PKValue returns a value of primary key for that record. Returned interface{} value is never untyped nil.

func (*RemoteService) Pointers added in v1.16.0

func (s *RemoteService) Pointers() []interface{}

Pointers returns a slice of pointers to struct or record fields. Returned interface{} values are never untyped nils.

func (*RemoteService) SetPK added in v1.16.0

func (s *RemoteService) SetPK(pk interface{})

SetPK sets record primary key.

func (RemoteService) String added in v1.16.0

func (s RemoteService) String() string

String returns a string representation of this struct or record.

func (*RemoteService) Table added in v1.16.0

func (s *RemoteService) Table() reform.Table

Table returns Table object for that record.

func (*RemoteService) Values added in v1.16.0

func (s *RemoteService) Values() []interface{}

Values returns a slice of struct or record field values. Returned interface{} values are never untyped nils.

func (*RemoteService) View added in v1.16.0

func (s *RemoteService) View() reform.View

View returns View object for that struct.

type Service

type Service struct {
	ID     int32       `reform:"id,pk"`
	Type   ServiceType `reform:"type"`
	NodeID int32       `reform:"node_id"`
}

func (*Service) HasPK

func (s *Service) HasPK() bool

HasPK returns true if record has non-zero primary key set, false otherwise.

func (*Service) PKPointer

func (s *Service) PKPointer() interface{}

PKPointer returns a pointer to primary key field for that record. Returned interface{} value is never untyped nil.

func (*Service) PKValue

func (s *Service) PKValue() interface{}

PKValue returns a value of primary key for that record. Returned interface{} value is never untyped nil.

func (*Service) Pointers

func (s *Service) Pointers() []interface{}

Pointers returns a slice of pointers to struct or record fields. Returned interface{} values are never untyped nils.

func (*Service) SetPK

func (s *Service) SetPK(pk interface{})

SetPK sets record primary key.

func (Service) String

func (s Service) String() string

String returns a string representation of this struct or record.

func (*Service) Table

func (s *Service) Table() reform.Table

Table returns Table object for that record.

func (*Service) Values

func (s *Service) Values() []interface{}

Values returns a slice of struct or record field values. Returned interface{} values are never untyped nils.

func (*Service) View

func (s *Service) View() reform.View

View returns View object for that struct.

type ServiceType

type ServiceType string
const (
	RDSServiceType        ServiceType = "rds"
	PostgreSQLServiceType ServiceType = "postgresql"
	MySQLServiceType      ServiceType = "mysql"
)

Jump to

Keyboard shortcuts

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