database

package
v0.0.0-...-e46bc45 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

* Copyright (c) 2024, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAppSub

func AddAppSub(tx pgx.Tx, uuid, appUUID, subUUID, organization string) error

AddAppSub adds an application subscription mapping to the database

func AddApplication

func AddApplication(tx pgx.Tx, uuid, name, owner, org string) error

AddApplication adds an application to the database

func AddApplicationAttributes

func AddApplicationAttributes(tx pgx.Tx, appUUID, name, appAttribute string) error

AddApplicationAttributes adds attributes to an application in the database

func AddApplicationKeyMapping

func AddApplicationKeyMapping(tx pgx.Tx, applicationUUID, securityScheme, applicationIdentifier, keyType, env,
	organization string) error

AddApplicationKeyMapping adds a key mapping to the database

func AddSubscription

func AddSubscription(tx pgx.Tx, uuid, apiName, apiVersion, subStatus, organization string) error

AddSubscription adds a subscription to the database

func CloseDBConn

func CloseDBConn()

CloseDBConn closes the database connection

func ConnectToDB

func ConnectToDB()

ConnectToDB connects to the database

func DeleteAllAppAttributes

func DeleteAllAppAttributes(tx pgx.Tx) error

DeleteAllAppAttributes deletes all attributes of all applications from the database

func DeleteAllAppSub

func DeleteAllAppSub(tx pgx.Tx) error

DeleteAllAppSub deletes all application subscription mappings from the database

func DeleteAllApplicationKeyMappings

func DeleteAllApplicationKeyMappings(tx pgx.Tx) error

DeleteAllApplicationKeyMappings deletes all key mappings from the database

func DeleteAllApplications

func DeleteAllApplications(tx pgx.Tx) error

DeleteAllApplications deletes all applications from the database

func DeleteAllSubscriptions

func DeleteAllSubscriptions(tx pgx.Tx) error

DeleteAllSubscriptions deletes all subscriptions from the database

func DeleteAppSub

func DeleteAppSub(tx pgx.Tx, uuid string) error

DeleteAppSub deletes an application subscription mapping from the database

func DeleteApplication

func DeleteApplication(tx pgx.Tx, uuid string) error

DeleteApplication deletes an application from the database

func DeleteApplicationAttributes

func DeleteApplicationAttributes(tx pgx.Tx, appUUID string) error

DeleteApplicationAttributes deletes attributes of an application from the database

func DeleteApplicationKeyMapping

func DeleteApplicationKeyMapping(tx pgx.Tx, applicationUUID, securityScheme, env string) error

DeleteApplicationKeyMapping deletes a key mapping from the database

func DeleteSubscription

func DeleteSubscription(tx pgx.Tx, uuid string) error

DeleteSubscription deletes a subscription from the database

func ExecDBQuery

func ExecDBQuery(tx pgx.Tx, query string, args ...interface{}) error

ExecDBQuery executes a database query

func ExecDBQueryRows

func ExecDBQueryRows(tx pgx.Tx, query string, args ...interface{}) (pgx.Rows, error)

ExecDBQueryRows executes a database query and returns a row

func GetAllAppSubs

func GetAllAppSubs(tx pgx.Tx) ([]server.ApplicationMapping, error)

GetAllAppSubs gets all application subscription mappings from the database

func GetAllApplicationKeyMappings

func GetAllApplicationKeyMappings(tx pgx.Tx) ([]server.ApplicationKeyMapping, error)

GetAllApplicationKeyMappings gets all application key mappings from the database

func GetAllApplications

func GetAllApplications(tx pgx.Tx) ([]server.Application, error)

GetAllApplications gets all applications from the database

func GetAllSubscription

func GetAllSubscription(tx pgx.Tx) ([]server.Subscription, error)

GetAllSubscription gets all subscriptions from the database

func IsAliveConn

func IsAliveConn(ctx context.Context) (isAlive bool)

IsAliveConn checks if the database connection is alive

func PrepareQueries

func PrepareQueries(tx pgx.Tx, queries ...string)

PrepareQueries prepares the queries

func UpdateAppSub

func UpdateAppSub(tx pgx.Tx, uuid, appUUID, subUUID, organization string) error

UpdateAppSub updates an application subscription mapping in the database

func UpdateApplication

func UpdateApplication(tx pgx.Tx, uuid, name, owner, org string) error

UpdateApplication updates an application in the database

func UpdateApplicationKeyMapping

func UpdateApplicationKeyMapping(tx pgx.Tx, applicationUUID, securityScheme, applicationIdentifier, keyType, env,
	organization string) error

UpdateApplicationKeyMapping updates a key mapping in the database

func UpdateSubscription

func UpdateSubscription(tx pgx.Tx, uuid, apiName, apiVersion, subStatus, organization string) error

UpdateSubscription updates a subscription in the database

Types

type DBDeployer

type DBDeployer struct {
	// contains filtered or unexported fields
}

DBDeployer is a struct that implements ArtifactDeployer interface

func NewDBArtifactDeployer

func NewDBArtifactDeployer(mgr manager.Manager) DBDeployer

NewDBArtifactDeployer creates a new NewDBDeployer

func (DBDeployer) DeleteAllApplicationMappings

func (dbDeployer DBDeployer) DeleteAllApplicationMappings() error

DeleteAllApplicationMappings deletes all application mappings

func (DBDeployer) DeleteAllKeyMappings

func (dbDeployer DBDeployer) DeleteAllKeyMappings() error

DeleteAllKeyMappings deletes all key mappings

func (DBDeployer) DeleteAllSubscriptions

func (dbDeployer DBDeployer) DeleteAllSubscriptions() error

DeleteAllSubscriptions deletes all subscriptions

func (DBDeployer) DeleteApplication

func (dbDeployer DBDeployer) DeleteApplication(applicationID string) error

DeleteApplication deletes an application

func (DBDeployer) DeleteApplicationMappings

func (dbDeployer DBDeployer) DeleteApplicationMappings(applicationMapping string) error

DeleteApplicationMappings deletes an application mapping

func (DBDeployer) DeleteKeyMappings

func (dbDeployer DBDeployer) DeleteKeyMappings(keyMapping server.ApplicationKeyMapping) error

DeleteKeyMappings deletes a key mapping

func (DBDeployer) DeleteSubscription

func (dbDeployer DBDeployer) DeleteSubscription(subscriptionID string) error

DeleteSubscription deletes a subscription

func (DBDeployer) DeployAllApplicationMappings

func (dbDeployer DBDeployer) DeployAllApplicationMappings(applicationMappings server.ApplicationMappingList) error

DeployAllApplicationMappings deploys all application mappings

func (DBDeployer) DeployAllApplications

func (dbDeployer DBDeployer) DeployAllApplications(applications server.ApplicationList) error

DeployAllApplications deploys all key mappings

func (DBDeployer) DeployAllKeyMappings

func (dbDeployer DBDeployer) DeployAllKeyMappings(keyMappings server.ApplicationKeyMappingList) error

DeployAllKeyMappings deploys all key mappings

func (DBDeployer) DeployAllSubscriptions

func (dbDeployer DBDeployer) DeployAllSubscriptions(subscriptions server.SubscriptionList) error

DeployAllSubscriptions deploys all subscriptions

func (DBDeployer) DeployApplication

func (dbDeployer DBDeployer) DeployApplication(application server.Application) error

DeployApplication deploys an application

func (DBDeployer) DeployApplicationMappings

func (dbDeployer DBDeployer) DeployApplicationMappings(applicationMapping server.ApplicationMapping) error

DeployApplicationMappings deploys an application mapping

func (DBDeployer) DeployKeyMappings

func (dbDeployer DBDeployer) DeployKeyMappings(keyMapping server.ApplicationKeyMapping) error

DeployKeyMappings deploys a key mapping

func (DBDeployer) DeploySubscription

func (dbDeployer DBDeployer) DeploySubscription(subscription server.Subscription) error

DeploySubscription deploys a subscription

func (DBDeployer) GetAllApplicationMappings

func (dbDeployer DBDeployer) GetAllApplicationMappings() (server.ApplicationMappingList, error)

GetAllApplicationMappings returns all application mappings

func (DBDeployer) GetAllApplications

func (dbDeployer DBDeployer) GetAllApplications() (server.ApplicationList, error)

GetAllApplications returns all applications

func (DBDeployer) GetAllKeyMappings

func (dbDeployer DBDeployer) GetAllKeyMappings() (server.ApplicationKeyMappingList, error)

GetAllKeyMappings returns all key mappings

func (DBDeployer) GetAllSubscriptions

func (dbDeployer DBDeployer) GetAllSubscriptions() (server.SubscriptionList, error)

GetAllSubscriptions returns all subscriptions

func (DBDeployer) GetApplication

func (dbDeployer DBDeployer) GetApplication(applicationID string) (server.Application, error)

GetApplication returns an application

func (DBDeployer) GetApplicationMappings

func (dbDeployer DBDeployer) GetApplicationMappings(applicationID string) (server.ApplicationMapping, error)

GetApplicationMappings returns an application mapping

func (DBDeployer) GetKeyMappings

func (dbDeployer DBDeployer) GetKeyMappings(applicationID string) (server.ApplicationKeyMapping, error)

GetKeyMappings returns a key mapping

func (DBDeployer) GetSubscription

func (dbDeployer DBDeployer) GetSubscription(subscriptionID string) (server.Subscription, error)

GetSubscription returns a subscription

func (DBDeployer) UpdateApplication

func (dbDeployer DBDeployer) UpdateApplication(application server.Application) error

UpdateApplication updates an application

func (DBDeployer) UpdateApplicationMappings

func (dbDeployer DBDeployer) UpdateApplicationMappings(applicationMapping server.ApplicationMapping) error

UpdateApplicationMappings updates an application mapping

func (DBDeployer) UpdateKeyMappings

func (dbDeployer DBDeployer) UpdateKeyMappings(keyMapping server.ApplicationKeyMapping) error

UpdateKeyMappings updates a key mapping

func (DBDeployer) UpdateSubscription

func (dbDeployer DBDeployer) UpdateSubscription(subscription server.Subscription) error

UpdateSubscription updates a subscription

Jump to

Keyboard shortcuts

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