data

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRootCertificate added in v0.5.9

func AddRootCertificate(db *gorm.DB, cert *models.RootCertificate) error

func AppendProviderUsers

func AppendProviderUsers(db *gorm.DB, provider *models.Provider, user *models.User) error

func BindGroupUsers

func BindGroupUsers(db *gorm.DB, group *models.Group, users ...models.User) error

func BindUserGroups

func BindUserGroups(db *gorm.DB, user *models.User, groups ...models.Group) error

func Count

func Count[T models.Modelable](db *gorm.DB, selectors ...SelectorFunc) (*int64, error)

func CreateAccessKey

func CreateAccessKey(db *gorm.DB, accessKey *models.AccessKey) (body string, err error)

func CreateCredential added in v0.6.0

func CreateCredential(db *gorm.DB, credential *models.Credential) error

func CreateDestination

func CreateDestination(db *gorm.DB, destination *models.Destination) error

func CreateEncryptionKey

func CreateEncryptionKey(db *gorm.DB, key *models.EncryptionKey) (*models.EncryptionKey, error)

func CreateGrant

func CreateGrant(db *gorm.DB, grant *models.Grant) error

func CreateGroup

func CreateGroup(db *gorm.DB, group *models.Group) error

func CreateMachine

func CreateMachine(db *gorm.DB, machine *models.Machine) error

func CreateMachineToken added in v0.5.8

func CreateMachineToken(db *gorm.DB, machineID uid.ID) (token *models.Token, err error)

func CreateProvider

func CreateProvider(db *gorm.DB, provider *models.Provider) error

func CreateProviderToken

func CreateProviderToken(db *gorm.DB, token *models.ProviderToken) error

func CreateUser

func CreateUser(db *gorm.DB, user *models.User) error

func CreateUserToken added in v0.5.8

func CreateUserToken(db *gorm.DB, userID uid.ID) (token *models.Token, err error)

func DeleteAccessKey

func DeleteAccessKey(db *gorm.DB, id uid.ID) error

func DeleteAccessKeys

func DeleteAccessKeys(db *gorm.DB, selectors ...SelectorFunc) error

func DeleteCredential added in v0.6.0

func DeleteCredential(db *gorm.DB, id uid.ID) error

func DeleteDestinations

func DeleteDestinations(db *gorm.DB, selector SelectorFunc) error

func DeleteGrants

func DeleteGrants(db *gorm.DB, selectors ...SelectorFunc) error

func DeleteGroups

func DeleteGroups(db *gorm.DB, selectors ...SelectorFunc) error

func DeleteMachine

func DeleteMachine(db *gorm.DB, selectors ...SelectorFunc) error

func DeleteProviders

func DeleteProviders(db *gorm.DB, selectors ...SelectorFunc) error

func DeleteUser added in v0.6.0

func DeleteUser(db *gorm.DB, id uid.ID) error

func DeleteUsers

func DeleteUsers(db *gorm.DB, selectors ...SelectorFunc) error

func GetAccessKey added in v0.5.12

func GetAccessKey(db *gorm.DB, selectors ...SelectorFunc) (*models.AccessKey, error)

func GetCredential added in v0.6.0

func GetCredential(db *gorm.DB, selectors ...SelectorFunc) (*models.Credential, error)

func GetDestination

func GetDestination(db *gorm.DB, selectors ...SelectorFunc) (*models.Destination, error)

func GetEncryptionKey

func GetEncryptionKey(db *gorm.DB, selector SelectorFunc) (result *models.EncryptionKey, err error)

func GetGrant

func GetGrant(db *gorm.DB, selectors ...SelectorFunc) (*models.Grant, error)

func GetGroup

func GetGroup(db *gorm.DB, selectors ...SelectorFunc) (*models.Group, error)

func GetMachine

func GetMachine(db *gorm.DB, selectors ...SelectorFunc) (*models.Machine, error)

func GetProvider

func GetProvider(db *gorm.DB, selectors ...SelectorFunc) (*models.Provider, error)

func GetProviderToken

func GetProviderToken(db *gorm.DB, selector SelectorFunc) (*models.ProviderToken, error)

func GetRootCertificate added in v0.5.9

func GetRootCertificate(db *gorm.DB, selectors ...SelectorFunc) (*models.RootCertificate, error)

func GetSettings

func GetSettings(db *gorm.DB) (*models.Settings, error)

func GetUser

func GetUser(db *gorm.DB, selectors ...SelectorFunc) (*models.User, error)

func InitializeSettings

func InitializeSettings(db *gorm.DB, setupRequired bool) (*models.Settings, error)

func ListAccessKeys

func ListAccessKeys(db *gorm.DB, selectors ...SelectorFunc) ([]models.AccessKey, error)

func ListDestinations

func ListDestinations(db *gorm.DB, selectors ...SelectorFunc) ([]models.Destination, error)

func ListGrants

func ListGrants(db *gorm.DB, selectors ...SelectorFunc) ([]models.Grant, error)

func ListGroupGrants

func ListGroupGrants(db *gorm.DB, groupID uid.ID) (result []models.Grant, err error)

func ListGroups

func ListGroups(db *gorm.DB, selectors ...SelectorFunc) ([]models.Group, error)

func ListMachineGrants added in v0.5.8

func ListMachineGrants(db *gorm.DB, machineID uid.ID) (result []models.Grant, err error)

func ListMachines

func ListMachines(db *gorm.DB, selectors ...SelectorFunc) ([]models.Machine, error)

func ListProviders

func ListProviders(db *gorm.DB, selectors ...SelectorFunc) ([]models.Provider, error)

func ListRootCertificates added in v0.5.9

func ListRootCertificates(db *gorm.DB) ([]models.RootCertificate, error)

func ListTrustedClientCertificates added in v0.5.9

func ListTrustedClientCertificates(db *gorm.DB) ([]models.TrustedCertificate, error)

func ListUserGrants

func ListUserGrants(db *gorm.DB, userID uid.ID) (result []models.Grant, err error)

func ListUserGroups

func ListUserGroups(db *gorm.DB, userID uid.ID) (result []models.Group, err error)

func ListUsers

func ListUsers(db *gorm.DB, selectors ...SelectorFunc) ([]models.User, error)

func NewDB

func NewDB(connection gorm.Dialector) (*gorm.DB, error)

func NewPostgresDriver

func NewPostgresDriver(connection string) (gorm.Dialector, error)

func NewSQLiteDriver

func NewSQLiteDriver(connection string) (gorm.Dialector, error)

func SaveAccessKey added in v0.5.8

func SaveAccessKey(db *gorm.DB, key *models.AccessKey) error

func SaveCredential added in v0.6.0

func SaveCredential(db *gorm.DB, credential *models.Credential) error

func SaveDestination

func SaveDestination(db *gorm.DB, destination *models.Destination) error

func SaveMachine added in v0.5.8

func SaveMachine(db *gorm.DB, machine *models.Machine) error

func SaveProvider

func SaveProvider(db *gorm.DB, provider *models.Provider) error

func SaveSettings added in v0.5.9

func SaveSettings(db *gorm.DB, settings *models.Settings) error

func SaveUser

func SaveUser(db *gorm.DB, user *models.User) error

func TrustPublicKey added in v0.5.9

func TrustPublicKey(db *gorm.DB, tc *models.TrustedCertificate) error

TrustPublicKey trusts a public key (in base64 format) from a user or service Callers must have received the key from a mTLS/e2ee (mutually encrypted), trusted source.

func UpdateProviderToken

func UpdateProviderToken(db *gorm.DB, token *models.ProviderToken) error

func ValidateAccessKey added in v0.5.8

func ValidateAccessKey(db *gorm.DB, authnKey string) (*models.AccessKey, error)

func ValidateCredential added in v0.6.0

func ValidateCredential(db *gorm.DB, user *models.User, password string) (bool, error)

Types

type SelectorFunc

type SelectorFunc func(db *gorm.DB) *gorm.DB

func ByEmail

func ByEmail(email string) SelectorFunc

func ByEncryptionKeyID

func ByEncryptionKeyID(keyID int32) SelectorFunc

func ByID

func ByID(id uid.ID) SelectorFunc

func ByIDs

func ByIDs(ids []uid.ID) SelectorFunc

func ByIdentity

func ByIdentity(polymorphicID uid.PolymorphicID) SelectorFunc

func ByKey

func ByKey(key string) SelectorFunc

func ByMachineIDIssuedFor added in v0.5.8

func ByMachineIDIssuedFor(machineID uid.ID) SelectorFunc

func ByName

func ByName(name string) SelectorFunc

func ByNotExpired added in v0.5.9

func ByNotExpired() SelectorFunc

func ByNotIDs added in v0.5.9

func ByNotIDs(ids []uid.ID) SelectorFunc

func ByPrivilege

func ByPrivilege(s string) SelectorFunc

func ByProviderID

func ByProviderID(id uid.ID) SelectorFunc

func ByPublicKey added in v0.5.9

func ByPublicKey(key []byte) SelectorFunc

func ByResource

func ByResource(s string) SelectorFunc

func ByURL

func ByURL(url string) SelectorFunc

func ByUniqueID

func ByUniqueID(nodeID string) SelectorFunc

func ByUserID

func ByUserID(userID uid.ID) SelectorFunc

func ByUserIDIssuedFor added in v0.5.9

func ByUserIDIssuedFor(userID uid.ID) SelectorFunc

func Limit added in v0.5.9

func Limit(limit int) SelectorFunc

func NotCreatedBy added in v0.5.9

func NotCreatedBy(id uid.ID) SelectorFunc

NotCreatedBy filters out entities not created by the passed in ID

func OrderBy added in v0.5.9

func OrderBy(order string) SelectorFunc

Jump to

Keyboard shortcuts

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