Documentation ¶
Overview ¶
(C) Copyright 2019 Intel Corporation.
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.
GOVERNMENT LICENSE RIGHTS-OPEN SOURCE SOFTWARE The Government's rights to use, modify, reproduce, release, perform, display, or disclose this software are subject to the terms of the Apache License as provided in Contract No. 8F-30005. Any reproduction of computer software, computer software documentation, or portions thereof marked with this legend must also reproduce the markings.
(C) Copyright 2019 Intel Corporation.
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.
GOVERNMENT LICENSE RIGHTS-OPEN SOURCE SOFTWARE The Government's rights to use, modify, reproduce, release, perform, display, or disclose this software are subject to the terms of the Apache License as provided in Contract No. 8F-30005. Any reproduction of computer software, computer software documentation, or portions thereof marked with this legend must also reproduce the markings.
(C) Copyright 2019 Intel Corporation.
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.
GOVERNMENT LICENSE RIGHTS-OPEN SOURCE SOFTWARE The Government's rights to use, modify, reproduce, release, perform, display, or disclose this software are subject to the terms of the Apache License as provided in Contract No. 8F-30005. Any reproduction of computer software, computer software documentation, or portions thereof marked with this legend must also reproduce the markings.
(C) Copyright 2019 Intel Corporation.
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.
GOVERNMENT LICENSE RIGHTS-OPEN SOURCE SOFTWARE The Government's rights to use, modify, reproduce, release, perform, display, or disclose this software are subject to the terms of the Apache License as provided in Contract No. 8F-30005. Any reproduction of computer software, computer software documentation, or portions thereof marked with this legend must also reproduce the markings.
Index ¶
- Constants
- func IsFailedRequest(err error) bool
- type ForwardChecker
- type ForwardableRequest
- type Forwarder
- type Request
- type RequestFailure
- type Response
- type StdioAddr
- type StdioConn
- func (sc *StdioConn) Close() error
- func (sc *StdioConn) LocalAddr() net.Addr
- func (sc *StdioConn) Read(b []byte) (int, error)
- func (sc *StdioConn) RemoteAddr() net.Addr
- func (sc *StdioConn) SetDeadline(t time.Time) error
- func (sc *StdioConn) SetReadDeadline(t time.Time) error
- func (sc *StdioConn) SetWriteDeadline(t time.Time) error
- func (sc *StdioConn) String() string
- func (sc *StdioConn) Write(b []byte) (int, error)
- type StdioListener
Constants ¶
const ( // DaosAdminName is the name of the daos_admin privileged helper. DaosAdminName = "daos_admin" // DisableReqFwdEnvVar is the name of the environment variable which // can be set to disable forwarding requests to the privileged binary. DisableReqFwdEnvVar = "DAOS_DISABLE_REQ_FWD" // DaosAdminLogFileEnvVar is the name of the environment variable which // can be set to enable non-ERROR logging in the privileged binary. DaosAdminLogFileEnvVar = "DAOS_ADMIN_LOG_FILE" )
const MaxMessageSize = 4096
Variables ¶
This section is empty.
Functions ¶
func IsFailedRequest ¶
Types ¶
type ForwardChecker ¶ added in v0.9.0
type ForwardChecker interface {
IsForwarded() bool
}
ForwardChecker defines an interface for any request that could have been forwarded.
type ForwardableRequest ¶ added in v0.9.0
type ForwardableRequest struct {
Forwarded bool
}
ForwardableRequest is intended to be embedded into request types that can be forwarded to the privileged binary.
func (ForwardableRequest) IsForwarded ¶ added in v0.9.0
func (r ForwardableRequest) IsForwarded() bool
IsForwarded implements the ForwardChecker interface.
type Forwarder ¶ added in v0.9.0
type Forwarder struct { Disabled bool // contains filtered or unexported fields }
Forwarder provides a common implementation of a request forwarder.
func NewForwarder ¶ added in v0.9.0
NewForwarder returns a configured *Forwarder.
type Request ¶
type Request struct { Method string Payload json.RawMessage }
Request represents a request sent to the privileged binary. The payload field contains a JSON-encoded representation of the wrapped request.
type RequestFailure ¶
type RequestFailure struct {
Message string
}
RequestFailure represents a failed request. The error message (if available) is stored as a string in the Message field.
func (*RequestFailure) Error ¶
func (rf *RequestFailure) Error() string
type Response ¶
type Response struct { Error *RequestFailure Payload json.RawMessage }
Response represents a response received from the privileged binary. The payload field contains a JSON-encoded representation of the wrapped response.
type StdioAddr ¶
type StdioAddr struct {
// contains filtered or unexported fields
}
StdioAddr implements net.Addr to provide an emulated network address for use with StdioConn.
type StdioConn ¶
StdioConn implements net.Conn to provide an emulated network connection between two processes over stdin/stdout.
func NewStdioConn ¶
func NewStdioConn(localID, remoteID string, in io.ReadCloser, out io.WriteCloser) *StdioConn
func (*StdioConn) RemoteAddr ¶
type StdioListener ¶
type StdioListener struct {
// contains filtered or unexported fields
}
StdioListener wraps a *StdioConn to implement net.Listener.
func NewStdioListener ¶
func NewStdioListener(conn *StdioConn) *StdioListener
func (*StdioListener) Addr ¶
func (sl *StdioListener) Addr() net.Addr
func (*StdioListener) Close ¶
func (sl *StdioListener) Close() error