Documentation ¶
Overview ¶
(C) Copyright 2019-2020 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 2020 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-2020 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-2020 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-2020 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 CheckHelper(log logging.Logger, helperName string) error
- func PrivilegedHelperNotAvailable(helperName string) *fault.Fault
- func PrivilegedHelperNotPrivileged(helperName string) *fault.Fault
- func PrivilegedHelperRequestFailed(message string) *fault.Fault
- func ReadMessage(conn io.Reader) ([]byte, error)
- type ForwardChecker
- type ForwardableRequest
- type Forwarder
- type Request
- type Response
- type StdioAddr
- type StdioConn
- func (sc *StdioConn) Close() error
- func (sc *StdioConn) CloseRead() error
- func (sc *StdioConn) CloseWrite() 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 ( // MessageBufferSize is the starting size of the receive buffer. If // the buffer must be grown to accommodate larger messages, it is // expanded in increments of this value. MessageBufferSize = 1024 // MaxMessageSize is the largest single message that can be written to // or read from the privileged binary. MaxMessageSize = MessageBufferSize * 1024 )
const ( // DaosAdminName is the name of the daos_admin privileged helper. DaosAdminName = "daos_admin" // 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" )
Variables ¶
This section is empty.
Functions ¶
func CheckHelper ¶ added in v0.9.1
CheckHelper attempts to invoke the helper to test for installation/setup problems. This function can be used to proactively identify problems and avoid console spam from multiple errors.
func PrivilegedHelperNotAvailable ¶ added in v0.9.1
func PrivilegedHelperNotPrivileged ¶ added in v0.9.1
func PrivilegedHelperRequestFailed ¶ added in v0.9.1
func ReadMessage ¶ added in v0.9.1
ReadMessage attempts to read a message from the sender and returns a buffer containing the message if successful. Relies on the writer being closed so that the reader gets an io.EOF to signal that the message is complete.
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 Response ¶
type Response struct { Error *fault.Fault 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) CloseWrite ¶ added in v0.9.1
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