common

package
v0.0.0-...-1fa52ee Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0, BSD-2-Clause, ISC, + 1 more Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	USER = "user"
)

Variables

View Source
var DateTimeFormats []DateTimeFormatItem

DateTimeFormats FIXME ...

Functions

func ConvertStringToTime

func ConvertStringToTime(timeString string) (t time.Time, err error)

ConvertStringToTime FIXME ...

func Iso8601TimeToTime

func Iso8601TimeToTime(iso8601Time *Iso8601Time) *time.Time

Iso8601TimeToTime FIXME ...

Types

type CSTTime

type CSTTime time.Time

CSTTime FIXME ...

func (*CSTTime) Scan

func (jt *CSTTime) Scan(v interface{}) error

Scan FIXME ...

func (*CSTTime) UnmarshalJSON

func (jt *CSTTime) UnmarshalJSON(b []byte) error

UnmarshalJSON FIXME ...

func (CSTTime) Value

func (jt CSTTime) Value() (driver.Value, error)

Value FIXME ...

type Creator

type Creator struct {
	Creator      string `json:"creator"`
	CreatorEmail string `json:"creatorEmail"`
}

type DateTimeFormatItem

type DateTimeFormatItem struct {
	Matcher *regexp.Regexp
	Format  string
}

DateTimeFormatItem FIXME ... TODO: move this to helper

type GetRawDataOrigin

type GetRawDataOrigin interface {
	GetRawDataOrigin() *RawDataOrigin
}

type Iso8601Time

type Iso8601Time struct {
	Time time.Time
	// contains filtered or unexported fields
}

Iso8601Time is type time.Time

func (Iso8601Time) MarshalJSON

func (jt Iso8601Time) MarshalJSON() ([]byte, error)

MarshalJSON FIXME ...

func (*Iso8601Time) Scan

func (jt *Iso8601Time) Scan(v interface{}) error

Scan FIXME ...

func (*Iso8601Time) String

func (jt *Iso8601Time) String() string

func (*Iso8601Time) ToNullableTime

func (jt *Iso8601Time) ToNullableTime() *time.Time

ToNullableTime FIXME ...

func (*Iso8601Time) ToTime

func (jt *Iso8601Time) ToTime() time.Time

ToTime FIXME ...

func (*Iso8601Time) UnmarshalJSON

func (jt *Iso8601Time) UnmarshalJSON(b []byte) error

UnmarshalJSON FIXME ...

func (*Iso8601Time) Value

func (jt *Iso8601Time) Value() (driver.Value, error)

Value FIXME ...

type Model

type Model struct {
	ID        uint64    `gorm:"primaryKey" json:"id"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

type NoPKModel

type NoPKModel struct {
	CreatedAt     time.Time `json:"createdAt" mapstructure:"createdAt"`
	UpdatedAt     time.Time `json:"updatedAt" mapstructure:"updatedAt"`
	RawDataOrigin `swaggerignore:"true" mapstructure:",squash"`
}

func NewNoPKModel

func NewNoPKModel() NoPKModel

type RawDataOrigin

type RawDataOrigin struct {
	// can be used for flushing outdated records from table
	RawDataParams string `gorm:"column:_raw_data_params;type:varchar(255);index" json:"_raw_data_params" mapstructure:"rawDataParams"`
	RawDataTable  string `gorm:"column:_raw_data_table;type:varchar(255)" json:"_raw_data_table" mapstructure:"rawDataTable"`
	// can be used for debugging
	RawDataId uint64 `gorm:"column:_raw_data_id" json:"_raw_data_id" mapstructure:"rawDataId"`
	// we can store record index into this field, which is helpful for debugging
	RawDataRemark string `gorm:"column:_raw_data_remark" json:"_raw_data_remark" mapstructure:"rawDataRemark"`
}

embedded fields for tool layer tables

func (*RawDataOrigin) GetRawDataOrigin

func (c *RawDataOrigin) GetRawDataOrigin() *RawDataOrigin

type Scope

type Scope struct {
	NoPKModel     `mapstructure:",squash"`
	ConnectionId  uint64 `json:"connectionId" gorm:"primaryKey" validate:"required" mapstructure:"connectionId,omitempty"`
	ScopeConfigId uint64 `json:"scopeConfigId,omitempty" mapstructure:"scopeConfigId,omitempty"`
}

func (Scope) ScopeConnectionId

func (s Scope) ScopeConnectionId() uint64

ScopeConnectionId implements plugin.ToolLayerScope.

func (Scope) ScopeScopeConfigId

func (s Scope) ScopeScopeConfigId() uint64

type ScopeConfig

type ScopeConfig struct {
	Model
	Entities     []string `gorm:"type:json;serializer:json" json:"entities" mapstructure:"entities"`
	ConnectionId uint64   `json:"connectionId" gorm:"index" validate:"required" mapstructure:"connectionId,omitempty"`
	Name         string   `mapstructure:"name" json:"name" gorm:"type:varchar(255);uniqueIndex" validate:"required"`
}

func (ScopeConfig) ScopeConfigConnectionId

func (s ScopeConfig) ScopeConfigConnectionId() uint64

func (ScopeConfig) ScopeConfigId

func (s ScopeConfig) ScopeConfigId() uint64

type ScopeConfigOperator

type ScopeConfigOperator[T dal.Tabler] interface {
	*T
	SetConnectionId(t *T, connectionId uint64)
}

type StringFloat64

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

func NewStringFloat64FromAny

func NewStringFloat64FromAny(f interface{}) *StringFloat64

func (*StringFloat64) MarshalJSON

func (f *StringFloat64) MarshalJSON() ([]byte, error)

func (*StringFloat64) Scan

func (f *StringFloat64) Scan(v interface{}) error

func (*StringFloat64) String

func (f *StringFloat64) String() string

func (*StringFloat64) UnmarshalJSON

func (f *StringFloat64) UnmarshalJSON(data []byte) error

func (*StringFloat64) Value

func (f *StringFloat64) Value() (driver.Value, error)

type Updater

type Updater struct {
	Updater      string `json:"updater"`
	UpdaterEmail string `json:"updaterEmail"`
}

type User

type User struct {
	Name  string
	Email string
}

Jump to

Keyboard shortcuts

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