sqlmodel

package
v0.0.0-...-bf83fb3 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CredentialTableName     = "arc_credential"
	CredentialDefaultSortBy = "arc_credential_id"

	ECode040B01 = e.Code040B + "01"
	ECode040B02 = e.Code040B + "02"
	ECode040B03 = e.Code040B + "03"
	ECode040B04 = e.Code040B + "04"
	ECode040B05 = e.Code040B + "05"
	ECode040B06 = e.Code040B + "06"
)
View Source
const (
	DataTableName = "arc_data"

	ECode040C01 = e.Code040C + "01"
	ECode040C02 = e.Code040C + "02"
	ECode040C03 = e.Code040C + "03"
	ECode040C04 = e.Code040C + "04"
	ECode040C05 = e.Code040C + "05"
	ECode040C06 = e.Code040C + "06"
	ECode040C07 = e.Code040C + "07"
	ECode040C08 = e.Code040C + "08"
	ECode040C09 = e.Code040C + "09"
	ECode040C0A = e.Code040C + "0A"
	ECode040C0B = e.Code040C + "0B"
)
View Source
const (
	DeploymentTableName     = "arc_deployment"
	DeploymentDefaultSortBy = "arc_deployment_id"

	ECode040D01 = e.Code040D + "01"
	ECode040D02 = e.Code040D + "02"
	ECode040D03 = e.Code040D + "03"
	ECode040D04 = e.Code040D + "04"
	ECode040D05 = e.Code040D + "05"
	ECode040D06 = e.Code040D + "06"
	ECode040D07 = e.Code040D + "07"
)
View Source
const (
	DeploymentGrantTableName     = "arc_deployment_grant"
	DeploymentGrantDefaultSortBy = "arc_deployment_grant_id"

	ECode040Z01 = e.Code040Z + "01"
	ECode040Z02 = e.Code040Z + "02"
	ECode040Z03 = e.Code040Z + "03"
	ECode040Z04 = e.Code040Z + "04"
	ECode040Z05 = e.Code040Z + "05"
	ECode040Z06 = e.Code040Z + "06"
	ECode040Z07 = e.Code040Z + "07"
	ECode040Z08 = e.Code040Z + "08"
	ECode040Z09 = e.Code040Z + "09"
	ECode040Z0A = e.Code040Z + "0A"
)

Variables

This section is empty.

Functions

func CredentialGet

func CredentialGet(db *sql.Connection,
	p *CredentialGetParam) (cList []*model.Credential, count int, err error)

CredentialGet performs select

func CredentialGetByID

func CredentialGetByID(db *sql.Connection, id int) (c *model.Credential, err error)

CredentialGetByID returns the deployment with the specified code

func DataGet

func DataGet(db *sql.Connection,
	p *DataGetParam) (dList []*model.Data, count int, err error)

DataGet performs select

func DataGetByObjectID

func DataGetByObjectID(db *sql.Connection, deploymentID int, appCode model.AppCode,
	appCoreID uint, t model.DataType, objectID uint) (d *model.Data, err error)

DataGetByObjectID returns record associated with the object id, must also include the app code, app core id and data type to be unique

func DataSetStatus

func DataSetStatus(db *sql.Connection, s model.DataStatus, d *model.Data) (err error)

DataSetStatus set the status for the specified data record

func DataSetStatusProcessed

func DataSetStatusProcessed(db *sql.Connection) (err error)

DataSetStatusProcessed set all records that are processing to processed

func DataSetStatusProcessing

func DataSetStatusProcessing(db *sql.Connection) (err error)

DataSetStatusProcessing set all records that are pending to processing

func DataUpsert

func DataUpsert(db *sql.Connection, deploymentID int, d *model.Data) (err error)

DataUpsert upserts the record and only updates an existing record if the hash has changed or if the deleted flag has changed. When updating, it will calculate the hash and set the new object, hash and/or deleted flag. Also, it sets the status to pending in this scenario

func DeploymentGet

func DeploymentGet(db *sql.Connection,
	p *DeploymentGetParam) (dList []*model.Deployment, count int, err error)

DeploymentGet performs select

func DeploymentGetByCode

func DeploymentGetByCode(db *sql.Connection, code string) (d *model.Deployment, err error)

DeploymentGetByCode returns the deployment with the specified code

func DeploymentGrantGet

func DeploymentGrantGet(db *sql.Connection,
	p *DeploymentGrantGetParam) (dgList []*model.DeploymentGrant, count int, err error)

DeploymentGrantGet performs select

func DeploymentGrantGetByToken

func DeploymentGrantGetByToken(db *sql.Connection, token string) (dg *model.DeploymentGrant, err error)

DeploymentGrantGetByToken returns the deployment with the specified token

func DeploymentGrantInsert

func DeploymentGrantInsert(db *sql.Connection, ip *DeploymentGrantInsertParam) (id int, err error)

DeploymentGrantInsert performs insert

func DeploymentGrantPurgeByExpiredRefreshToken

func DeploymentGrantPurgeByExpiredRefreshToken(db *sql.Connection, refreshTokenExpiry int) (err error)

DeploymentGrantPurgeByExpiredRefreshToken purges all grants where the refresh token has expired and is no longer useable (the token should have expired as well at this point because refresh tokens are periodically updated when fetching new tokens)

func DeploymentGrantPurgeByToken

func DeploymentGrantPurgeByToken(db *sql.Connection, token string) (err error)

DeploymentGrantPurgeByToken purges a record by the token

func DeploymentGrantUpdate

func DeploymentGrantUpdate(db *sql.Connection, id int, up *DeploymentGrantUpdateParam) (err error)

DeploymentGrantUpdate performs update, setting token/refresh token (and expiries)

func DeploymentUpdate

func DeploymentUpdate(db *sql.Connection, id int, dup *DeploymentUpdateParam) (err error)

DeploymentUpdate performs update, setting token/refresh token (and expiries)

Types

type CredentialGetParam

type CredentialGetParam struct {
	Limit        uint64
	Offset       uint64
	ID           *int
	DeploymentID *int
	FlagCount    bool
	OrderByID    string
	OrderByCode  string
}

UserGetParam model

type DataGetParam

type DataGetParam struct {
	Limit           uint64
	Offset          uint64
	DeploymentID    *int
	AppCode         *model.AppCode
	AppCoreID       *uint
	Type            *model.DataType
	ObjectID        *uint
	Status          *model.DataStatus
	FlagCount       bool
	OrderBy         string
	OrderByTypeList []model.DataType
	Handle          func(*model.Data) error
}

DataGetParam model

type DeploymentGetParam

type DeploymentGetParam struct {
	Limit       uint64
	Offset      uint64
	ID          *int
	Code        *string
	FlagCount   bool
	OrderByID   string
	OrderByCode string
}

UserGetParam model

type DeploymentGrantGetParam

type DeploymentGrantGetParam struct {
	Limit                     uint64
	Offset                    uint64
	ID                        *int
	DeploymentID              *int
	Token                     *string
	FlagCount                 bool
	OrderByID                 string
	OrderByRefreshTokenExpiry string
}

DeploymentGrantGetParam get params

type DeploymentGrantInsertParam

type DeploymentGrantInsertParam struct {
	DeploymentID       int
	ArcUserID          int
	CredentialID       int
	Token              string
	TokenExpiry        int
	RefreshToken       string
	RefreshTokenExpiry int
}

DeploymentGrantInsertParam insert params

type DeploymentGrantUpdateParam

type DeploymentGrantUpdateParam struct {
	Token              *string
	TokenExpiry        *int
	RefreshToken       *string
	RefreshTokenExpiry *int
}

DeploymentGrantUpdateParam update params

type DeploymentUpdateParam

type DeploymentUpdateParam struct {
	Token              *string
	TokenExpiry        *int
	RefreshToken       *string
	RefreshTokenExpiry *int
}

UserUpdateParam model

Jump to

Keyboard shortcuts

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