tmodel

package
v0.0.0-...-81c02da Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package tmodel ....

Index

Constants

This section is empty.

Variables

View Source
var (
	// GetDBConnectionFunc is pointer func for common.GetDBConnection
	GetDBConnectionFunc = common.GetDBConnection
)

Functions

func GenericSave

func GenericSave(ctx context.Context, body []byte, table string, key string) error

GenericSave will save any resource data into the database

func GetAllKeysFromTable

func GetAllKeysFromTable(ctx context.Context, table string, dbtype common.DbType) ([]string, error)

GetAllKeysFromTable fetches all keys in a given table

func GetResource

func GetResource(ctx context.Context, Table, key string, dbtype common.DbType) (string, *errors.Error)

GetResource fetches a resource from database using table and key

Types

type Plugin

type Plugin struct {
	IP                string
	Port              string
	Username          string
	Password          []byte
	ID                string
	PluginType        string
	PreferredAuthType string
}

Plugin is the model for plugin information

func GetPluginData

func GetPluginData(pluginID string) (Plugin, *errors.Error)

GetPluginData will fetch plugin details

type Target

type Target struct {
	ManagerAddress string `json:"ManagerAddress"`
	Password       []byte `json:"Password"`
	UserName       string `json:"UserName"`
	PostBody       []byte `json:"PostBody"`
	DeviceUUID     string `json:"DeviceUUID"`
	PluginID       string `json:"PluginID"`
}

Target is for sending the requst to south bound/plugin

func GetTarget

func GetTarget(ctx context.Context, deviceUUID string) (*Target, *errors.Error)

GetTarget fetches the System(Target Device Credentials) table details

Jump to

Keyboard shortcuts

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