models

package
v0.0.0-...-617b798 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCertificateRequest

func CreateCertificateRequest(name, req, token, certificate string) (err error)

func CreateNamespace

func CreateNamespace(name, key, nonce string) (err error)

func CreateSecret

func CreateSecret(key, value, namespace string) (err error)

Types

type Certificate

type Certificate struct {
	ID          uint   `json:"id" gorm:"primaryKey;autoIncrement"`
	Name        string `json:"name" gorm:"unique;not null"`
	SignRequest string `json:"req" gorm:"not null"`
	Certificate string `json:"certificate"`
	Token       string `json:"token" gorm:"unique;not null"`
}

func GetCertificate

func GetCertificate(name string) (cert Certificate, err error)

func UpdateSignedCertificateByName

func UpdateSignedCertificateByName(name, signed string) (cert Certificate, err error)

func (Certificate) IsEmpty

func (c Certificate) IsEmpty() bool

type Namespace

type Namespace struct {
	ID        uint   `json:"namespace_id" gorm:"primaryKey;autoIncrement"`
	Name      string `json:"name" gorm:"unique;not null"`
	MasterKey string
	Nonce     string
}

func GetNamespace

func GetNamespace(name string) (n Namespace, err error)

func ListNamespace

func ListNamespace() (n []Namespace, err error)

func (Namespace) IsEmpty

func (ns Namespace) IsEmpty() bool

type Secret

type Secret struct {
	ID          uint      `json:"id" gorm:"primaryKey;autoIncrement"`
	Key         string    `json:"key"`
	Value       string    `json:"value"`
	NamespaceID uint      `json:"namespace_id" gorm:"foreignKey:NamespaceID"`
	Namespace   Namespace `json:"namespace"`
}

func GetSecret

func GetSecret(key, namespace string) (s Secret, err error)

func (Secret) IsEmpty

func (s Secret) IsEmpty() bool

Jump to

Keyboard shortcuts

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