starkapi

package
v1.1.8284267019 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiClient added in v1.1.5743455404

type ApiClient interface {
	Init(host string) *Client
	Auth(accessToken, username string) (*response.AuthResponse, error)
	Login(un string, pw string) (*response.AuthResponse, error)
	ApiStatus() (*response.StatusResponse, error)
	Search(body Query) (*response.SearchResponse, error)
	DeletePoint(id uint32) (*response.DeleteResponse, error)
	DeleteEquip(id uint32) (*response.DeleteResponse, error)
	DeleteSite(id uint32) (*response.DeleteResponse, error)
	// contains filtered or unexported methods
}

type AssetTreeApi added in v1.0.36

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

func (*AssetTreeApi) Get added in v1.0.36

func (assetTreeApi *AssetTreeApi) Get() (domain.AssetTree, error)

func (*AssetTreeApi) GetBranch added in v1.0.36

func (assetTreeApi *AssetTreeApi) GetBranch(id uint32) (domain.Branch, error)

func (*AssetTreeApi) GetChildren added in v1.0.36

func (assetTreeApi *AssetTreeApi) GetChildren(id uint32) (domain.AssetTree, error)

func (*AssetTreeApi) GetParents added in v1.0.36

func (assetTreeApi *AssetTreeApi) GetParents(id uint32) (domain.AssetTree, error)

type AssetsApi added in v1.1.2974061736

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

func (*AssetsApi) AddNewTag added in v1.1.2974061736

func (assetsApi *AssetsApi) AddNewTag(asset domain.Asset, tagName string, tagValue string) error

func (*AssetsApi) AddNewTags added in v1.1.3023876239

func (assetsApi *AssetsApi) AddNewTags(asset domain.Asset, tags []domain.Tag) error

func (*AssetsApi) CreateAuditLog added in v1.1.5954711553

func (assetsApi *AssetsApi) CreateAuditLog(asset domain.Asset, log domain.AuditLog) error

func (*AssetsApi) DeleteTag added in v1.1.3003046089

func (assetsApi *AssetsApi) DeleteTag(asset domain.Asset, tagName string) error

type Client

type Client struct {
	AssetTreeApi AssetTreeApi
	AssetsApi    AssetsApi
	StatusApi    StatusApi
	SearchApi    SearchApi
	PointApi     PointApi
	EquipApi     EquipApi
	SiteApi      SiteApi
	ProfileApi   ProfileApi
	ConnApi      ConnApi
	GeoApi       GeoApi
	UridApi      UridApi
	TagApi       TagApi
	FormsApi     FormsApi
	// contains filtered or unexported fields
}

func (*Client) ApiStatus

func (client *Client) ApiStatus() (*response.StatusResponse, error)

func (*Client) Auth added in v1.0.66

func (client *Client) Auth(accessToken, username string) (*response.AuthResponse, error)

Auth

func (*Client) DeleteEquip

func (client *Client) DeleteEquip(id uint32) (*response.DeleteResponse, error)

func (*Client) DeletePoint

func (client *Client) DeletePoint(id uint32) (*response.DeleteResponse, error)

func (*Client) DeleteSite

func (client *Client) DeleteSite(id uint32) (*response.DeleteResponse, error)

func (*Client) Init

func (client *Client) Init(host string) *Client

func (*Client) Login

func (client *Client) Login(un string, pw string) (*response.AuthResponse, error)

func (*Client) Search

func (client *Client) Search(body Query) (*response.SearchResponse, error)

type ConnApi

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

func (*ConnApi) BaseUrl

func (connApi *ConnApi) BaseUrl() string

func (*ConnApi) GetAll

func (connApi *ConnApi) GetAll() (domain.Conns, error)

func (*ConnApi) GetOne

func (connApi *ConnApi) GetOne(id uint32) (domain.Conn, error)

type EquipApi

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

func (*EquipApi) AddNewTag

func (equipApi *EquipApi) AddNewTag(equip domain.Equip, name string, value string) error

func (*EquipApi) BaseUrl

func (equipApi *EquipApi) BaseUrl() string

func (*EquipApi) CreateOne

func (equipApi *EquipApi) CreateOne(ask domain.Equip) (domain.Equip, error)

func (*EquipApi) CurVals added in v1.0.37

func (equipApi *EquipApi) CurVals(equipId uint32, urids []string) (domain.EquipCurVals, error)

func (*EquipApi) DeleteTag added in v1.1.3027747033

func (equipApi *EquipApi) DeleteTag(equip domain.Equip, tagRef domain.TagRef) error

DeleteTag deletes a domain.TagRef from the provided domain.Equip

func (*EquipApi) GetAll added in v1.0.27

func (equipApi *EquipApi) GetAll() (domain.Equips, error)

func (*EquipApi) GetAllTags added in v1.1.3027747033

func (equipApi *EquipApi) GetAllTags(equip domain.Equip) (domain.TagRefs, error)

GetAllTags returns all tags for the provided domain.Point

func (*EquipApi) GetOne added in v1.0.27

func (equipApi *EquipApi) GetOne(id uint32) (domain.Equip, error)

func (*EquipApi) UpdateOne added in v1.0.29

func (equipApi *EquipApi) UpdateOne(id uint32, jsonBody []byte) (domain.Equip, error)

type FormsApi added in v1.1.3039586334

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

func (*FormsApi) CreateControlOnRef added in v1.1.5753949227

func (formsApi *FormsApi) CreateControlOnRef(formControlName string, ref string, value string) (domain.FormControlRef, error)

func (*FormsApi) GetAllControls added in v1.1.3039586334

func (formsApi *FormsApi) GetAllControls() (domain.FormControlList, error)

func (*FormsApi) GetAllControlsForAsset added in v1.1.3039586334

func (formsApi *FormsApi) GetAllControlsForAsset(ref string) (domain.FormControlRefList, error)

func (*FormsApi) GetControlByName added in v1.1.5743455404

func (formsApi *FormsApi) GetControlByName(name string) (domain.FormControl, error)

type GeoApi added in v1.0.39

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

func (*GeoApi) BaseUrl added in v1.0.39

func (geoApi *GeoApi) BaseUrl() string

func (*GeoApi) ClimateZone added in v1.0.39

func (geoApi *GeoApi) ClimateZone(county string, state string) (domain.ClimateZone, error)

returns climate zone for a county and state

func (*GeoApi) GeoCoding added in v1.0.39

func (geoApi *GeoApi) GeoCoding(address string, city string, state string, postalCode string) (domain.GeoCoding, error)

returns geocoding for an address

type Parameter added in v1.1.2974061736

type Parameter struct {
	Column    string
	Operator  string
	Value     interface{}
	Type      string
	Decorator string
	AscSort   bool
	DescSort  bool
}

type PointApi

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

func (*PointApi) AddNewTag

func (pointApi *PointApi) AddNewTag(point domain.Point, name string, value string) error

func (*PointApi) BaseUrl

func (pointApi *PointApi) BaseUrl() string

func (*PointApi) CreateOne

func (pointApi *PointApi) CreateOne(ask domain.Point) (domain.Point, error)

func (*PointApi) CurVal added in v1.0.35

func (pointApi *PointApi) CurVal(id uint32) (domain.CurVal, error)

func (*PointApi) DeleteTag added in v1.1.3027747033

func (pointApi *PointApi) DeleteTag(point domain.Point, tagRef domain.TagRef) error

DeleteTag deletes a domain.TagRef from the provided domain.Point

func (*PointApi) GetAll added in v1.0.71

func (pointApi *PointApi) GetAll(limit, offset int) (domain.Points, error)

GetAll returns all points within the given limit and offset

func (*PointApi) GetAllByRef added in v1.0.70

func (pointApi *PointApi) GetAllByRef(ref string) (domain.Points, error)

func (*PointApi) GetAllPointTypes added in v1.1.8284267019

func (pointApi *PointApi) GetAllPointTypes() (domain.PointTypes, error)

func (*PointApi) GetAllTags added in v1.1.3027747033

func (pointApi *PointApi) GetAllTags(point domain.Point) (domain.TagRefs, error)

GetAllTags returns all tags for the provided domain.Point

func (*PointApi) GetOne added in v1.0.35

func (pointApi *PointApi) GetOne(id uint32) (domain.Point, error)

func (*PointApi) HisRead added in v1.0.35

func (pointApi *PointApi) HisRead(id uint32, limit uint16, start uint64, end uint64) (domain.HisRead, error)

func (*PointApi) ListPointTypeUrl added in v1.1.8284267019

func (pointApi *PointApi) ListPointTypeUrl() string

func (*PointApi) UpdateOne added in v1.0.29

func (pointApi *PointApi) UpdateOne(id uint32, jsonBody []byte) (domain.Point, error)

type ProfileApi

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

func (*ProfileApi) GetAll

func (profileApi *ProfileApi) GetAll() (domain.Profiles, error)

func (*ProfileApi) GetOne

func (profileApi *ProfileApi) GetOne(id uint32) (domain.Profile, error)

type Query

type Query struct {
	Query       string `json:"query"`
	CurrentPage uint16 `json:"currentPage"`
	PageSize    uint16 `json:"pageSize"`
}

type QueryParams added in v1.1.2974061736

type QueryParams struct {
	Id            string `json:"id" schema:"id" sqlColumn:"id" sqlType:"bigint"`
	Ref           string `json:"ref" schema:"ref" sqlColumn:"ref" sqlType:"text"`
	ProfileName   string `json:"profileName" schema:"profileName" sqlColumn:"profile_name" sqlType:"text"`
	SiteId        string `json:"siteId" schema:"siteId" sqlColumn:"site_id" sqlType:"bigint"`
	SiteRef       string `json:"siteRef" schema:"siteRef" sqlColumn:"site_ref" sqlType:"text"`
	SiteName      string `json:"siteName" schema:"siteName" sqlColumn:"site_name" sqlType:"text"`
	ProfileRef    string `json:"profileRef" schema:"profileRef" sqlColumn:"profile_ref" sqlType:"text"`
	EquipId       string `json:"equipId" schema:"equipId" sqlColumn:"equip_id" sqlType:"bigint"`
	EquipRef      string `json:"equipRef" schema:"equipRef" sqlColumn:"equip_ref" sqlType:"text"`
	EquipName     string `json:"equipName" schema:"equipName" sqlColumn:"equip_name" sqlType:"text"`
	RuleName      string `json:"ruleName" schema:"ruleName" sqlColumn:"rule_name" sqlType:"text"`
	RuleId        string `json:"ruleId" schema:"ruleId" sqlColumn:"rule_id" sqlType:"bigint"`
	Severity      string `json:"severity" schema:"severity" sqlColumn:"severity" sqlType:"int"`
	Duration      string `json:"dur" schema:"dur" sqlColumn:"dur" sqlType:"bigint"`
	PersonId      string `json:"personId" schema:"personId" sqlColumn:"person_id" sqlType:"bigint"`
	Ts            string `json:"ts" schema:"ts" sqlColumn:"ts" sqlType:"bigint" sqlDecorator:"to_timestamp(%)"`
	EndTs         string `json:"endTs" schema:"endTs" sqlColumn:"end_ts" sqlType:"bigint" sqlDecorator:"to_timestamp(%)"`
	EventRef      string `json:"eventRef" schema:"eventRef" sqlColumn:"event_ref" sqlType:"text"`
	Name          string `json:"name" schema:"name" sqlColumn:"name" sqlType:"text"`
	GeoCity       string `json:"geoCity" schema:"geoCity" sqlColumn:"geo_city" sqlType:"text"`
	GeoPostalCode string `json:"geoPostalCode" schema:"geoPostalCode" sqlColumn:"geo_postal_code" sqlType:"text"`
	Lat           string `json:"lat" schema:"lat" sqlColumn:"lat" sqlType:"float"`
	Lon           string `json:"lon" schema:"lon" sqlColumn:"lon" sqlType:"float"`
	Gsf           string `json:"gsf" schema:"gsf" sqlColumn:"gsf" sqlType:"int"`
	GeoAddress2   string `json:"geoAddress2" schema:"geoAddress2" sqlColumn:"geo_address2" sqlType:"text"`
	GeoAddress1   string `json:"geoAddress1" schema:"geoAddress1" sqlColumn:"geo_address1" sqlType:"text"`
	GeoStateCode  string `json:"geoStateCode" schema:"geoStateCode" sqlColumn:"geo_state_code" sqlType:"text"`
	Description   string `json:"description" schema:"description" sqlColumn:"description" sqlType:"text"`
	EventId       string `json:"eventId" schema:"eventId" sqlColumn:"event_id" sqlType:"bigint"`

	Limit               int    `json:"limit" schema:"limit"`
	Offset              int    `json:"offset" schema:"offset"`
	RequestName         string `json:"-" schema:"-"`
	EventType           string `json:"eventType" schema:"eventType" sqlColumn:"event_type" sqlType:"text"`
	DateCreated         string `json:"dateCreated" schema:"dateCreated" sqlColumn:"date_created" sqlType:"bigint"`
	IssueStatus         string `json:"issueStatus" schema:"issueStatus" sqlColumn:"issue_status_id" sqlType:"bigint"`
	TargetRef           string `json:"targetRef" schema:"targetRef" sqlColumn:"target_ref" sqlType:"text"`
	EquipType           string `json:"equipType" schema:"equipType" sqlColumn:"equip_type_name" sqlType:"text"`
	EquipTypeName       string `json:"equipTypeName" schema:"equipTypeName" sqlColumn:"equip_type_name" sqlType:"text"`
	EquipTypeId         string `json:"equipTypeId" schema:"equipTypeId" sqlColumn:"equip_type_id" sqlType:"bigint"`
	EquipTypeConfigName string `json:"equipTypeConfigName" schema:"equipTypeConfigName" sqlColumn:"equip_type_config_name" sqlType:"text"`
	PointTypeName       string `json:"pointTypeName" schema:"pointTypeName" sqlColumn:"point_type_name" sqlType:"text"`
	PointTypeId         string `json:"pointTypeId" schema:"pointTypeId" sqlColumn:"point_type_id" sqlType:"bigint"`
	PointUridName       string `json:"pointUridName" schema:"pointUridName" sqlColumn:"point_urid_name" sqlType:"text"`
	PointUridId         string `json:"pointUridId" schema:"pointUridId" sqlColumn:"point_urid_id" sqlType:"bigint"`
	Unit                string `json:"unit" schema:"unit" sqlColumn:"unit" sqlType:"text"`
	Category            string `json:"category" schema:"category" sqlColumn:"category" sqlType:"text"`
	Batch               string `json:"batch" schema:"batch" sqlColumn:"batch" sqlType:"text"`
	SortA               string `json:"sortA" schema:"sortA"`
	SortD               string `json:"sortD" schema:"sortD"`
	WebAppMeta          string `json:"webAppMeta" schema:"webAppMeta" sqlColumn:"web_app_meta" sqlType:"text"`
	FirstName           string `json:"firstName" schema:"firstName" sqlColumn:"first_name" sqlType:"text"`
	PhoneNumber         string `json:"phoneNumber" schema:"phoneNumber" sqlColumn:"phone_number" sqlType:"text"`
	Username            string `json:"username" schema:"username" sqlColumn:"username" sqlType:"text"`
	LastName            string `json:"lastName" schema:"lastName" sqlColumn:"last_name" sqlType:"text"`
	Email               string `json:"email" schema:"email" sqlColumn:"email" sqlType:"text"`
	Enabled             string `json:"enabled" schema:"enabled" sqlColumn:"enabled" sqlType:"boolean"`
	Code                string `json:"code" schema:"code" sqlColumn:"code" sqlType:"text"`
	EulaOk              string `json:"eulaOk" schema:"eulaOk" sqlColumn:"eula_ok" sqlType:"boolean"`
	PasswordExpired     string `json:"passwordExpired" schema:"passwordExpired" sqlColumn:"password_expired" sqlType:"boolean"`
	Deleted             string `json:"deleted" schema:"deleted" sqlColumn:"deleted" sqlType:"boolean"`
	AccountExpired      string `json:"accountExpired" schema:"accountExpired" sqlColumn:"account_expired" sqlType:"boolean"`
	AccountLocked       string `json:"accountLocked" schema:"accountLocked" sqlColumn:"account_locked" sqlType:"boolean"`
}

func (*QueryParams) BuildParameterizedQuery added in v1.1.2974061736

func (q *QueryParams) BuildParameterizedQuery(sql string) (string, []interface{}, error)

BuildParameterizedQuery appends a parametrized query to the provided sql statement and returns the query with arguments

func (*QueryParams) DecodeParameters added in v1.1.2974061736

func (q *QueryParams) DecodeParameters() ([]Parameter, error)

func (*QueryParams) HashKey added in v1.1.2974061736

func (q *QueryParams) HashKey() string

HashKey creates a compounded string of the current QueryParams

func (*QueryParams) Validate added in v1.1.2974061736

func (q *QueryParams) Validate() bool

type SearchApi

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

func (*SearchApi) Search

func (searchApi *SearchApi) Search(query Query) (*response.SearchResponse, error)

* Search using a query

func (*SearchApi) SearchText

func (searchApi *SearchApi) SearchText(query string, page uint16, size uint16) (*response.SearchResponse, error)

convenience func to Search(Query)

type SiteApi

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

func (*SiteApi) AddNewTag

func (siteApi *SiteApi) AddNewTag(site domain.Site, name string, value string) error

func (*SiteApi) BaseUrl

func (siteApi *SiteApi) BaseUrl() string

func (*SiteApi) CreateOne

func (siteApi *SiteApi) CreateOne(ask domain.Site) (domain.Site, error)

func (*SiteApi) GetAll

func (siteApi *SiteApi) GetAll() (domain.Sites, error)

returns all the sites the current auth has access to

func (*SiteApi) GetOne

func (siteApi *SiteApi) GetOne(id uint32) (domain.Site, error)

returns one site provided the id

func (*SiteApi) UpdateOne added in v1.0.30

func (siteApi *SiteApi) UpdateOne(id uint32, jsonBody []byte) (domain.Site, error)

type StatusApi

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

func (*StatusApi) Get added in v1.0.36

func (statusApi *StatusApi) Get() (*response.StatusResponse, error)

type TagApi added in v1.0.60

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

func (*TagApi) BaseUrl added in v1.0.60

func (tagApi *TagApi) BaseUrl() string

func (*TagApi) Suggest added in v1.0.60

func (tagApi *TagApi) Suggest(query string, context string) ([]domain.Tag, error)

type UridApi added in v1.0.53

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

func (*UridApi) AdminUrl added in v1.0.53

func (uridApi *UridApi) AdminUrl() string

func (*UridApi) BaseUrl added in v1.0.53

func (uridApi *UridApi) BaseUrl() string

func (*UridApi) CreateOne added in v1.0.53

func (uridApi *UridApi) CreateOne(ask domain.Urid) (domain.Urid, error)

func (*UridApi) GetAll added in v1.0.53

func (uridApi *UridApi) GetAll() (domain.Urids, error)

func (*UridApi) GetOne added in v1.0.53

func (uridApi *UridApi) GetOne(id uint32) (domain.Urid, error)

func (*UridApi) UpdateOne added in v1.0.53

func (uridApi *UridApi) UpdateOne(id uint32, jsonBody []byte) (domain.Urid, error)

Jump to

Keyboard shortcuts

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