Fix lint warnings.
This commit was merged in pull request #11.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
//Package ipp provides functonality to handle ipp messages
|
||||
package ipp
|
||||
|
||||
import (
|
||||
@@ -56,26 +57,26 @@ const (
|
||||
memberAttrNameValueTag tag = 0x4a
|
||||
)
|
||||
|
||||
// Operation-id, defined in rfc8011
|
||||
type OperationId uint16
|
||||
// OperationID is defined in rfc8011
|
||||
type OperationID uint16
|
||||
|
||||
const (
|
||||
PrintJob OperationId = 0x0002
|
||||
PrintURI OperationId = 0x0003
|
||||
ValidateJob OperationId = 0x0004
|
||||
CreateJob OperationId = 0x0005
|
||||
SendDocument OperationId = 0x0006
|
||||
SendURI OperationId = 0x0007
|
||||
CancelJob OperationId = 0x0008
|
||||
GetJobAttributes OperationId = 0x0009
|
||||
GetJobs OperationId = 0x000a
|
||||
GetPrinterAttributes OperationId = 0x000b
|
||||
HoldJob OperationId = 0x000c
|
||||
ReleaseJob OperationId = 0x000d
|
||||
RestartJob OperationId = 0x000e
|
||||
PausePrinter OperationId = 0x0010
|
||||
ResumePrinter OperationId = 0x0011
|
||||
PurgeJobs OperationId = 0x0012
|
||||
PrintJob OperationID = 0x0002
|
||||
PrintURI OperationID = 0x0003
|
||||
ValidateJob OperationID = 0x0004
|
||||
CreateJob OperationID = 0x0005
|
||||
SendDocument OperationID = 0x0006
|
||||
SendURI OperationID = 0x0007
|
||||
CancelJob OperationID = 0x0008
|
||||
GetJobAttributes OperationID = 0x0009
|
||||
GetJobs OperationID = 0x000a
|
||||
GetPrinterAttributes OperationID = 0x000b
|
||||
HoldJob OperationID = 0x000c
|
||||
ReleaseJob OperationID = 0x000d
|
||||
RestartJob OperationID = 0x000e
|
||||
PausePrinter OperationID = 0x0010
|
||||
ResumePrinter OperationID = 0x0011
|
||||
PurgeJobs OperationID = 0x0012
|
||||
)
|
||||
|
||||
type printerState int32
|
||||
@@ -166,14 +167,14 @@ func (a *attributes) String() string {
|
||||
return s
|
||||
}
|
||||
|
||||
func (as *attributes) addAttribute(group tag, a Attribute) {
|
||||
func (a *attributes) addAttribute(group tag, attr Attribute) {
|
||||
switch group {
|
||||
case operationAttributes:
|
||||
as.operation = append(as.operation, a)
|
||||
a.operation = append(a.operation, attr)
|
||||
case jobAttributes:
|
||||
as.job = append(as.job, a)
|
||||
a.job = append(a.job, attr)
|
||||
case printerAttributes:
|
||||
as.printer = append(as.printer, a)
|
||||
a.printer = append(a.printer, attr)
|
||||
default:
|
||||
log.Error("Unknown attribute group")
|
||||
}
|
||||
@@ -210,7 +211,7 @@ func UnMarshalAttributues(body io.Reader) *attributes {
|
||||
a.addAttribute(currentAttributeGroup, c)
|
||||
log.Debugf("%v %v", c.name, c.value)
|
||||
case uriValueTag:
|
||||
u := NewUriValue("", "")
|
||||
u := NewURIValue("", "")
|
||||
u.unmarshal(body)
|
||||
a.addAttribute(currentAttributeGroup, u)
|
||||
log.Debugf("%v %v", u.name, u.value)
|
||||
|
||||
Reference in New Issue
Block a user