v1

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizeOptions

type AuthorizeOptions struct {
	TypeMeta `json:",inline"`
}

type CreateOptions

type CreateOptions struct {
	TypeMeta `json:",inline"`
	DryRun   []string `json:"dry_run,omitempty"`
}

type DeleteMeta

type DeleteMeta struct {
	DeletedAt soft_delete.DeletedAt `json:"deleted_at,omitempty" gorm:"type:int(11);column:deleted_at;comment:删除时间"`
}

DeleteMeta is delete meta data.

type DeleteOptions

type DeleteOptions struct {
	TypeMeta `json:",inline"`
	Unscoped bool `json:"unscoped"`
}

type Extend

type Extend map[string]interface{}

func (Extend) Merge

func (e Extend) Merge(extendShadow string) Extend

Merge merge extend fields from extendShadow.

func (Extend) String

func (e Extend) String() string

type GetOptions

type GetOptions struct {
	TypeMeta `json:",inline"`
}

GetOptions is the standard query options to the standard REST get call.

type ListInterface

type ListInterface interface {
	GetTotalCount() int64
	SetTotalCount(count int64)
}

type ListMeta

type ListMeta struct {
	TotalCount int64 `json:"total_count,omitempty"`
}

type ListOptions

type ListOptions struct {
	TypeMeta       `json:",inline"`
	LabelSelector  string `json:"label_selector,omitempty" form:"label_selector"`
	FieldSelector  string `json:"field_selector,omitempty" form:"field_selector"`
	TimeoutSeconds *int64 `json:"timeout_seconds,omitempty"`
	Offset         *int64 `json:"offset,omitempty" form:"offset"`
	Limit          *int64 `json:"limit,omitempty" form:"limit"`
}

type Object

type Object interface {
	GetID() uint64
	SetID(id uint64)
	GetCreatedAt() time.Time
	SetCreatedAt(createdAt time.Time)
	GetUpdatedAt() time.Time
	SetUpdatedAt(updatedAt time.Time)
}

type ObjectMeta

type ObjectMeta struct {
	ID uint64 `json:"id,omitempty" gorm:"primaryKey;autoIncrement;column:id"`

	// InstanceID defines a string type resource identifier,
	// use prefixed to distinguish resource types, easy to remember, Url-friendly.
	InstanceID string `json:"instance_id,omitempty" gorm:"unique;column:instance_id;type:varchar(32);not null"`

	// Required: true
	// Name must be unique. Is required when creating resources.
	// Name is primarily intended for creation idempotence and configuration
	// definition.
	// It will be generated automated only if Name is not specified.
	// Cannot be updated.
	Name string `json:"name,omitempty" gorm:"column:name;type:varchar(64);not null;comment:资源名"`

	CreatedAt int64 `json:"created_at,omitempty" gorm:"type:int(11);not null;column:created_at;comment:创建时间;"`
	UpdatedAt int64 `json:"updated_at,omitempty" gorm:"type:int(11);not null;column:updated_at;comment:更新时间;"`

	CreatedAtFormat string `json:"created_at_format,omitempty" gorm:"-"`
	UpdatedAtFormat string `json:"updated_at_format,omitempty" gorm:"-"`

	// 拓展字段
	Extend       Extend `json:"extend,omitempty" gorm:"-"`
	ExtendShadow string `json:"-" gorm:"column:extend_shadow"`
}

func (*ObjectMeta) AfterFind

func (obj *ObjectMeta) AfterFind(tx *gorm.DB) error

AfterFind run after find to unmarshal a extend shadown string into metav1.Extend struct.

func (*ObjectMeta) BeforeCreate

func (obj *ObjectMeta) BeforeCreate(tx *gorm.DB) error

BeforeCreate run before create database record.

func (*ObjectMeta) BeforeUpdate

func (obj *ObjectMeta) BeforeUpdate(tx *gorm.DB) error

BeforeUpdate run before update database record.

type PatchOptions

type PatchOptions struct {
	TypeMeta `json:",inline"`
	DryRun   []string `json:"dry_run,omitempty"`
	Force    bool     `json:"force,omitempty"`
}

type TableOptions

type TableOptions struct {
	TypeMeta  `json:",inline"`
	NoHeaders bool `json:"-"`
}

type TypeMeta

type TypeMeta struct {
	Kind       string `json:"kind,omitempty"`
	APIVersion string `json:"api_version,omitempty"`
}

type UpdateOptions

type UpdateOptions struct {
	TypeMeta `json:",inline"`
	DryRun   []string `json:"dry_run,omitempty"`
}

Jump to

Keyboard shortcuts

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