model

package
v0.0.0-...-e5f8ed5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	// Unique ID of the entity
	ID int64 `gorm:"primaryKey,autoIncrement"`
	// Project ID that own the entity
	ProjectID int64
	// CreatedAt creation timestamp
	CreatedAt time.Time
	// UpdatedAt last update timestamp
	UpdatedAt time.Time
}

Base is base model

type LogWriter

type LogWriter struct {
	// Base provides common DB model field, namely ID, ProjectID, CreatedAt, UpdatedAt
	Base
	// Name of the log writer
	Name string
	// Log Writer Source configuration
	Source *LogWriterSource `gorm:"type:jsonb"`
	// Deployment status of the log writer
	Status Status
	// Error message
	Error string `gorm:"size:2048"`
}

LogWriter data model for log writer

func LogWriterFromProto

func LogWriterFromProto(msg *timberv1.LogWriter) *LogWriter

LogWriterFromProto convert LogWriter proto to internal representation of LogWriter

func (*LogWriter) ToLogWriterProto

func (w *LogWriter) ToLogWriterProto() *timberv1.LogWriter

ToLogWriterProto convert internal LogWriter representation into LogWriter proto message

type LogWriterSource

type LogWriterSource struct {
	*timberv1.LogWriterSource
}

LogWriterSource is wrapper of LogWriterSource proto message to allow marshalling and unmarshalling to DB

func (*LogWriterSource) Scan

func (l *LogWriterSource) Scan(value interface{}) error

Scan parses jsonb as LogWriterSource

func (*LogWriterSource) Value

func (l *LogWriterSource) Value() (driver.Value, error)

Value marshall LogWriterSource to be stored as json blob to DB

type ObservationService

type ObservationService struct {
	// Base provides common DB model field, namely ID, ProjectID, CreatedAt, UpdatedAt
	Base
	// Name of observation service
	Name string
	// Source of the observation service
	Source *ObservationServiceSource `gorm:"type:jsonb"`
	// Deployment status of the observation service
	Status Status
	// Error message
	Error string `gorm:"size:2048"`
}

ObservationService observation service internal model representation

func ObservationServiceFromProto

func ObservationServiceFromProto(msg *timberv1.ObservationService) *ObservationService

ObservationServiceFromProto convert ObservationService proto to internal representation of ObservationService

func (*ObservationService) ToObservationServiceProto

func (w *ObservationService) ToObservationServiceProto() *timberv1.ObservationService

ToObservationServiceProto convert internal ObservationService representation into ObservationService proto message

type ObservationServiceSource

type ObservationServiceSource struct {
	*timberv1.ObservationServiceSource
}

ObservationServiceSource is wrapper of timberv1.ObservationServiceSource proto message to allow marshalling and unmarshalling to DB

func (*ObservationServiceSource) Scan

func (l *ObservationServiceSource) Scan(value interface{}) error

Scan parses jsonb as ObservationServiceSource

func (*ObservationServiceSource) Value

Value marshall ObservationServiceSource to be stored as json blob to DB

type Status

type Status string

Status deployment status

const (
	// StatusUnspecified status is not initialized
	StatusUnspecified Status = "STATUS_UNSPECIFIED"
	// StatusDeployed successfully deployed
	StatusDeployed Status = "STATUS_DEPLOYED"
	// StatusUninstalled successfully uninstalled
	StatusUninstalled Status = "STATUS_UNINSTALLED"
	// StatusFailed failed deployment
	StatusFailed Status = "STATUS_FAILED"
	// StatusPending waiting for deployment to complete
	StatusPending Status = "STATUS_PENDING"
)

func StatusFromProto

func StatusFromProto(statusProto timberv1.Status) Status

StatusFromProto creates internal status representation based on timberv1.Status proto message

func (Status) ToStatusProto

func (s Status) ToStatusProto() timberv1.Status

ToStatusProto convert internal status representation into timberv1.Status proto message

Jump to

Keyboard shortcuts

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