store

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultTableName = "atlas_gonnect_tenants"

Functions

This section is empty.

Types

type Store

type Store struct {
	Database *gorm.DB
	// contains filtered or unexported fields
}

func New

func New(dbType string, databaseUrl string) (store *Store, err error)

func NewFrom

func NewFrom(db *gorm.DB) (store *Store, err error)

func NewMustTableFrom

func NewMustTableFrom(table string, db *gorm.DB) (store *Store)

func NewTableFrom

func NewTableFrom(table string, db *gorm.DB) (store *Store, err error)

func (*Store) Delete

func (s *Store) Delete(clientKey string) (err error)

func (*Store) Get

func (s *Store) Get(clientKey string) (*Tenant, error)

func (*Store) GetByUrl

func (s *Store) GetByUrl(url string) (*Tenant, error)

func (*Store) Set

func (s *Store) Set(tenant *Tenant) (*Tenant, error)

func (*Store) Tx

func (s *Store) Tx() (tx *gorm.DB)

type Tenant

type Tenant struct {
	ClientKey      string `json:"clientKey" gorm:"type:varchar(255);primary_key"`
	PublicKey      string `json:"publicKey" gorm:"type:varchar(512)"`
	SharedSecret   string `json:"sharedSecret" gorm:"type:varchar(255);NOT NULL"`
	OauthClientId  string `json:"oauthClientId" gorm:"type:varchar(255)"`
	BaseURL        string `json:"baseUrl" gorm:"type:varchar(255);NOT NULL"`
	ProductType    string `json:"productType" gorm:"type:varchar(255)"`
	Description    string `json:"description" gorm:"type:varchar(255)"`
	AddonInstalled bool   `json:"-" gorm:"type:bool;NOT NULL"`
	CreatedAt      time.Time
	UpdatedAt      time.Time
	EventType      string         `json:"eventType" gorm:"-"`
	Context        datatypes.JSON `json:"context" gorm:"default:'{}'"`
}

func NewTenantFromReader

func NewTenantFromReader(r io.Reader) (*Tenant, error)

Jump to

Keyboard shortcuts

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