shared

package
v1.0.15 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2025 License: Apache-2.0, BSD-3-Clause Imports: 14 Imported by: 10

Documentation

Overview

*

  • Copyright 2022 Comcast Cable Communications Management, LLC *
  • 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. *
  • SPDX-License-Identifier: Apache-2.0

*

  • Copyright 2022 Comcast Cable Communications Management, LLC *
  • 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. *
  • SPDX-License-Identifier: Apache-2.0

*

  • Copyright 2022 Comcast Cable Communications Management, LLC *
  • 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. *
  • SPDX-License-Identifier: Apache-2.0

*

  • Copyright 2022 Comcast Cable Communications Management, LLC *
  • 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. *
  • SPDX-License-Identifier: Apache-2.0

*

  • Copyright 2022 Comcast Cable Communications Management, LLC *
  • 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. *
  • SPDX-License-Identifier: Apache-2.0

Index

Constants

View Source
const (
	STB      = "stb"
	XHOME    = "xhome"
	RDKCLOUD = "rdkcloud"
	SKY      = "sky"
	ALL      = "all"
)
View Source
const (
	TABLE_LOGS_KEY2_FIELD_NAME = "column1"
	LAST_CONFIG_LOG_ID         = "0"
)
View Source
const (
	StbContextTime      = "time"
	StbContextModel     = "model"
	MacList             = "MAC_LIST"
	IpList              = "IP_LIST"
	TableGenericNSList  = "GenericXconfNamedList"
	TableFirmwareConfig = "FirmwareConfig"
	TableFirmwareRule   = "FirmwareRule4"
)
View Source
const (
	Tftp  = "tftp"
	Http  = "http"
	Https = "https"
)
View Source
const (
	STRING      = "STRING"
	MAC_LIST    = "MAC_LIST"
	IP_LIST     = "IP_LIST"
	RI_MAC_LIST = "RI_MAC_LIST"
)

Variables

This section is empty.

Functions

func CreateGenericNamedListOneDB

func CreateGenericNamedListOneDB(newList *GenericNamespacedList) error

func DeleteOneEnvironment

func DeleteOneEnvironment(id string) error

func DeleteOneGenericNamedList

func DeleteOneGenericNamedList(id string) error

func DeleteOneModel

func DeleteOneModel(id string) error

func GetAppSettings

func GetAppSettings() (map[string]interface{}, error)

func GetBooleanAppSetting

func GetBooleanAppSetting(key string, vargs ...bool) bool

func GetFloat64AppSetting

func GetFloat64AppSetting(key string, vargs ...float64) float64

func GetGenericNamedListSetByType

func GetGenericNamedListSetByType(typeName string) (*util.Set, error)

func GetIntAppSetting

func GetIntAppSetting(key string, vargs ...int) int

func GetStringAppSetting

func GetStringAppSetting(key string, vargs ...string) string

func GetTimeAppSetting

func GetTimeAppSetting(key string, vargs ...time.Time) time.Time

func IsExistModel

func IsExistModel(id string) bool

func IsValidIpAddress

func IsValidIpAddress(input string) bool

func IsValidType

func IsValidType(stype string) bool

func NewAppSettingInf

func NewAppSettingInf() interface{}

NewAppSettingInf constructor

func NewEnvironmentInf

func NewEnvironmentInf() interface{}

NewEnvironmentInf constructor

func NewGenericNamespacedListInf

func NewGenericNamespacedListInf() interface{}

NewGenericNamespacedListInf constructor

func NewIpAddressGroupInf

func NewIpAddressGroupInf() interface{}

NewIpAddressGroupInf constructor

func NewModelInf

func NewModelInf() interface{}

NewModelInf constructor

func NewNamespacedListInf

func NewNamespacedListInf() interface{}

NewGenericNamespacedListInf constructor

func ValidateApplicationType

func ValidateApplicationType(applicationType string) error

func ValidateListData

func ValidateListData(typeName string, listData []string) error

func ValidateListDataForAdmin

func ValidateListDataForAdmin(typeName string, listData []string) error

Types

type AppSetting

type AppSetting struct {
	ID      string      `json:"id"`
	Updated int64       `json:"updated"`
	Value   interface{} `json:"value"`
}

AppSettings table object

func SetAppSetting

func SetAppSetting(key string, value interface{}) (*AppSetting, error)

func (*AppSetting) Clone

func (obj *AppSetting) Clone() (*AppSetting, error)

type Environment

type Environment struct {
	ID          string `json:"id"`
	Updated     int64  `json:"updated"`
	Description string `json:"description"`
}

Environment table object

func GetAllEnvironmentList

func GetAllEnvironmentList() []*Environment

func GetOneEnvironment

func GetOneEnvironment(id string) *Environment

func NewEnvironment

func NewEnvironment(id string, description string) *Environment

NewEnvironment ...

func SetOneEnvironment

func SetOneEnvironment(env *Environment) (*Environment, error)

func (*Environment) Clone

func (obj *Environment) Clone() (*Environment, error)

func (*Environment) CreateEnvironmentResponse

func (e *Environment) CreateEnvironmentResponse() *EnvironmentResponse

func (*Environment) Validate

func (obj *Environment) Validate() error

type EnvironmentResponse

type EnvironmentResponse struct {
	ID          string `json:"id"`
	Description string `json:"description,omitempty"`
}

type GenericNamespacedList

type GenericNamespacedList struct {
	ID       string   `json:"id"`
	Updated  int64    `json:"updated,omitempty"`
	Data     []string `json:"data"`
	TypeName string   `json:"typeName,omitempty"`
}

GenericNamespacedList GenericXconfNamedList table

func ConvertFromIpAddressGroup

func ConvertFromIpAddressGroup(ipAddressGroup *IpAddressGroup) *GenericNamespacedList

func GetGenericNamedListListsByTypeDB

func GetGenericNamedListListsByTypeDB(typeName string) ([]*GenericNamespacedList, error)

func GetGenericNamedListListsDB

func GetGenericNamedListListsDB() ([]*GenericNamespacedList, error)

func GetGenericNamedListOneByType

func GetGenericNamedListOneByType(id string, typeName string) (*GenericNamespacedList, error)

func GetGenericNamedListOneByTypeNonCached

func GetGenericNamedListOneByTypeNonCached(id string, typeName string) (*GenericNamespacedList, error)

func GetGenericNamedListOneDB

func GetGenericNamedListOneDB(id string) (*GenericNamespacedList, error)

func NewEmptyGenericNamespacedList

func NewEmptyGenericNamespacedList() *GenericNamespacedList

func NewGenericNamespacedList

func NewGenericNamespacedList(id string, typeName string, data []string) *GenericNamespacedList

TODO Updated is NOT included in the constructor. EVAL if it is ok

func NewIpList

func NewIpList() *GenericNamespacedList

func NewMacList

func NewMacList() *GenericNamespacedList

func (*GenericNamespacedList) Clone

func (*GenericNamespacedList) CreateGenericNamespacedListResponse

func (g *GenericNamespacedList) CreateGenericNamespacedListResponse() *GenericNamespacedList

func (*GenericNamespacedList) CreateIpAddressGroupResponse

func (g *GenericNamespacedList) CreateIpAddressGroupResponse() *IpAddressGroup

func (*GenericNamespacedList) IsInIpRange

func (g *GenericNamespacedList) IsInIpRange(ipAddressStr string) bool

func (*GenericNamespacedList) IsIpList

func (g *GenericNamespacedList) IsIpList() bool

func (*GenericNamespacedList) IsMacList

func (g *GenericNamespacedList) IsMacList() bool

func (*GenericNamespacedList) String

func (g *GenericNamespacedList) String() string

func (*GenericNamespacedList) Validate

func (obj *GenericNamespacedList) Validate() error

func (*GenericNamespacedList) ValidateDataIntersection

func (obj *GenericNamespacedList) ValidateDataIntersection() error

func (*GenericNamespacedList) ValidateForAdminService

func (obj *GenericNamespacedList) ValidateForAdminService() error

type GenericNamespacedListType

type GenericNamespacedListType string

GenericNamespacedListType

type IpAddress

type IpAddress struct {
	Address     string      `json:"address,omitempty" xml:"address,omitempty"`
	BaseAddress interface{} `json:"baseAddress,omitempty" xml:"baseAddress,omitempty"`
	// contains filtered or unexported fields
}

not getting the correct IP address. getting it from ip (net.IP) or ipNet (*net.IPNet) which are both nil, as opposed to the Address string value where there's actually data

func NewIpAddress

func NewIpAddress(input string) *IpAddress

func (IpAddress) Equals

func (a IpAddress) Equals(b IpAddress) bool

func (IpAddress) GetAddress

func (a IpAddress) GetAddress() string

func (IpAddress) IP

func (a IpAddress) IP() net.IP

func (IpAddress) IsCidrBlock

func (a IpAddress) IsCidrBlock() bool

func (IpAddress) IsInRange

func (a IpAddress) IsInRange(itf interface{}) bool

func (IpAddress) IsIpv6

func (a IpAddress) IsIpv6() bool

type IpAddressGroup

type IpAddressGroup struct {
	Id             string      `json:"id" xml:"id"`
	Name           string      `json:"name" xml:"name"`
	IpAddresses    []IpAddress `json:"-" xml:"-"`
	RawIpAddresses []string    `json:"ipAddresses" xml:"ipAddresses"` // custom unmarshal for IpAddresses
}

IpAddressGroup IpAddressGroupExtended table

func ConvertToIpAddressGroup

func ConvertToIpAddressGroup(genericIpList *GenericNamespacedList) *IpAddressGroup

func NewEmptyIpAddressGroup

func NewEmptyIpAddressGroup() *IpAddressGroup

func NewIpAddressGroup

func NewIpAddressGroup(input *IpAddressGroup) *IpAddressGroup

func NewIpAddressGroupWithAddrStrings

func NewIpAddressGroupWithAddrStrings(sid string, sname string, addrs []string) *IpAddressGroup

func (*IpAddressGroup) Clone

func (obj *IpAddressGroup) Clone() (*IpAddressGroup, error)

func (*IpAddressGroup) IsInRange

func (g *IpAddressGroup) IsInRange(itfs ...interface{}) bool

func (*IpAddressGroup) SetIpAddresses

func (g *IpAddressGroup) SetIpAddresses(addrs []string)

func (*IpAddressGroup) UnmarshalJSON

func (g *IpAddressGroup) UnmarshalJSON(bytes []byte) error

type MacAddress

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

func NewMacAddress

func NewMacAddress(s string) (*MacAddress, error)

func (*MacAddress) String

func (a *MacAddress) String() string

type Model

type Model struct {
	ID          string `json:"id"`
	Updated     int64  `json:"updated"`
	Description string `json:"description"`
}

Model table object

func GetAllModelList

func GetAllModelList() []*Model

func GetOneModel

func GetOneModel(id string) *Model

func NewModel

func NewModel(id string, description string) *Model

NewModel ...

func SetOneModel

func SetOneModel(model *Model) (*Model, error)

func (*Model) Clone

func (obj *Model) Clone() (*Model, error)

func (*Model) CreateModelResponse

func (m *Model) CreateModelResponse() *ModelResponse

func (*Model) Validate

func (obj *Model) Validate() error

type ModelResponse

type ModelResponse struct {
	ID          string `json:"id"`
	Description string `json:"description,omitempty"`
}

type NamespacedList

type NamespacedList struct {
	ID       string   `json:"id"`
	Updated  int64    `json:"updated"`
	Data     []string `json:"data"`
	TypeName string   `json:"typeName"`
}

NamespacedList XconfNamedList table

func (*NamespacedList) Clone

func (obj *NamespacedList) Clone() (*NamespacedList, error)

type StringListWrapper

type StringListWrapper struct {
	List []string `json:"list"`
}

StringListWrapper ...

func NewStringListWrapper

func NewStringListWrapper(list []string) *StringListWrapper

type XEnvModel

type XEnvModel interface {
	GetId() string
	GetDescription() string
}

XEnvModel is ...

Directories

Path Synopsis
*
*
*
*
*
*
*

Jump to

Keyboard shortcuts

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