Documentation ¶
Overview ¶
* * Copyright 2021 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 2021 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 2021 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 2021 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 2021 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 2021 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 2021 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 2021 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
- Variables
- func NewError(err error) error
- type BitMaskTuple
- type Document
- func (d *Document) Bytes() []byte
- func (d *Document) Equals(tdoc *Document) error
- func (d *Document) HasBytes() bool
- func (d *Document) Params() *string
- func (d *Document) SetBytes(bytes []byte)
- func (d *Document) SetParams(params *string)
- func (d *Document) SetState(state *int)
- func (d *Document) SetUpdatedTime(updatedTime *int64)
- func (d *Document) SetVersion(version *string)
- func (d *Document) State() *int
- func (d Document) String() string
- func (d *Document) UpdatedTime() *int64
- func (d *Document) Version() *string
- type Folder
- type Http400Error
- type Http404Error
- type Http500Error
- type HttpErrorResponse
- type HttpResponse
- type Multipart
- type PostTokenResponse
- type RemoteHttpError
- type RootDocument
- type ServerConfig
- type SupportedGroupsData
- type SupportedGroupsGetResponse
- type TR181Entry
- type TR181Output
- type Version
Constants ¶
const ( Deployed = iota + 1 PendingDownload InDeployment Failure )
const ( HeaderIfNoneMatch = "If-None-Match" HeaderFirmwareVersion = "X-System-Firmware-Version" HeaderSupportedDocs = "X-System-Supported-Docs" )
const ( TR181Str = 0 TR181Int = 1 TR181Uint = 2 TR181Bool = 3 TR181Blob = 12 )
const (
LoggingTimeFormat = "2006-01-02 15:04:05.000"
)
Variables ¶
var ( BinaryVersion = "" BinaryBranch = "" BinaryBuildTime = "" DefaultIgnoredHeaders = []string{ "Accept", "User-Agent", "Authorization", "Content-Type", "Content-Length", "Accept-Encoding", "X-B3-Sampled", "X-B3-Spanid", "X-B3-Traceid", "X-Envoy-Decorator-Operation", "X-Envoy-External-Address", "X-Envoy-Peer-Metadata", "X-Envoy-Peer-Metadata-Id", "X-Forwarded-Proto", } )
var ( Http400ErrorType = &Http400Error{} Http404ErrorType = &Http404Error{} Http500ErrorType = &Http500Error{} RemoteHttpErrorType = &RemoteHttpError{} )
var (
NotOK = fmt.Errorf("!ok")
)
var (
SubdocBitIndexMap = map[string]int{
"portforwarding": 1,
"lan": 2,
"wan": 3,
"macbinding": 4,
"xfinity": 5,
"bridge": 6,
"privatessid": 7,
"homessid": 8,
"radio": 9,
"moca": 10,
"xdns": 11,
"advsecurity": 12,
"mesh": 13,
"aker": 14,
"telemetry": 15,
"statusreport": 16,
"trafficreport": 17,
"interfacereport": 18,
"radioreport": 19,
}
)
var ( SupportedDocsBitMaskMap = map[int][]BitMaskTuple{ 1: []BitMaskTuple{ BitMaskTuple{1, 1}, BitMaskTuple{2, 2}, BitMaskTuple{3, 3}, BitMaskTuple{4, 4}, BitMaskTuple{5, 5}, BitMaskTuple{6, 6}, }, 2: []BitMaskTuple{ BitMaskTuple{1, 7}, BitMaskTuple{2, 8}, BitMaskTuple{3, 9}, }, 3: []BitMaskTuple{ BitMaskTuple{1, 10}, }, 4: []BitMaskTuple{ BitMaskTuple{1, 11}, }, 5: []BitMaskTuple{ BitMaskTuple{1, 12}, }, 6: []BitMaskTuple{ BitMaskTuple{1, 13}, }, 7: []BitMaskTuple{ BitMaskTuple{1, 14}, }, 8: []BitMaskTuple{ BitMaskTuple{1, 15}, }, 9: []BitMaskTuple{ BitMaskTuple{1, 16}, BitMaskTuple{2, 17}, }, 10: []BitMaskTuple{ BitMaskTuple{1, 18}, BitMaskTuple{2, 19}, }, } )
The group based bitmaps will be merged into 1 cpe bitmap 1: []BitMaskTuple{ // group_id:
BitMaskTuple{1, 1}, // {"index_of_bit_from_lsb" for a group bitmap, "index_of_bit_from_lsb" for the cpe bitmap
Functions ¶
Types ¶
type BitMaskTuple ¶
header X-System-Supported-Docs
type Document ¶
type Document struct {
// contains filtered or unexported fields
}
func NewDocument ¶
func (*Document) SetUpdatedTime ¶
func (*Document) SetVersion ¶
func (*Document) UpdatedTime ¶
type Folder ¶
type Folder struct {
// contains filtered or unexported fields
}
func (*Folder) DeleteDocument ¶
func (*Folder) SetDocument ¶
func (*Folder) VersionMap ¶
type Http400Error ¶
type Http400Error struct {
Message string
}
func (Http400Error) Error ¶
func (e Http400Error) Error() string
type Http404Error ¶
type Http404Error struct {
Message string
}
func (Http404Error) Error ¶
func (e Http404Error) Error() string
type Http500Error ¶
type Http500Error struct {
Message string
}
func (Http500Error) Error ¶
func (e Http500Error) Error() string
type HttpErrorResponse ¶
type HttpErrorResponse struct { Status int `json:"status"` ErrorCode int `json:"error_code,omitempty"` Message string `json:"message,omitempty"` Errors interface{} `json:"errors,omitempty"` }
http error response
type HttpResponse ¶
type HttpResponse struct { Status int `json:"status"` Message string `json:"message,omitempty"` Data interface{} `json:"data,omitempty"` }
http ok response
type PostTokenResponse ¶
type RemoteHttpError ¶
func (RemoteHttpError) Error ¶
func (e RemoteHttpError) Error() string
type RootDocument ¶
type RootDocument struct {
// contains filtered or unexported fields
}
func NewRootDocument ¶
func NewRootDocument(version string, bitmap int) *RootDocument
func (*RootDocument) Bitmap ¶
func (d *RootDocument) Bitmap() int
func (*RootDocument) Equals ¶
func (d *RootDocument) Equals(r *RootDocument) bool
func (*RootDocument) Version ¶
func (d *RootDocument) Version() string
type ServerConfig ¶
type ServerConfig struct { *configuration.Config // contains filtered or unexported fields }
func NewServerConfig ¶
func NewServerConfig(configFile string) (*ServerConfig, error)
func (*ServerConfig) ConfigBytes ¶
func (c *ServerConfig) ConfigBytes() []byte
type SupportedGroupsData ¶
type SupportedGroupsGetResponse ¶
type SupportedGroupsGetResponse struct { Data SupportedGroupsData `json:"data"` Message string `json:"message"` Status int `json:"status"` }
type TR181Entry ¶
type TR181Output ¶
type TR181Output struct {
Parameters []TR181Entry `json:"parameters" msgpack:"parameters"`
}