pbin

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

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.

Index

Constants

View Source
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"
)
View Source
const MaxMessageSize = 4096

Variables

This section is empty.

Functions

func IsFailedRequest

func IsFailedRequest(err error) bool

Types

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.

func ExecReq

func ExecReq(parent context.Context, log logging.Logger, binPath string, req *Request) (res *Response, err error)

type StdioAddr

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

StdioAddr implements net.Addr to provide an emulated network address for use with StdioConn.

func (*StdioAddr) Network

func (s *StdioAddr) Network() string

func (*StdioAddr) String

func (s *StdioAddr) String() string

type StdioConn

type StdioConn struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

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) Close

func (sc *StdioConn) Close() error

func (*StdioConn) LocalAddr

func (sc *StdioConn) LocalAddr() net.Addr

func (*StdioConn) Read

func (sc *StdioConn) Read(b []byte) (int, error)

func (*StdioConn) RemoteAddr

func (sc *StdioConn) RemoteAddr() net.Addr

func (*StdioConn) SetDeadline

func (sc *StdioConn) SetDeadline(t time.Time) error

func (*StdioConn) SetReadDeadline

func (sc *StdioConn) SetReadDeadline(t time.Time) error

func (*StdioConn) SetWriteDeadline

func (sc *StdioConn) SetWriteDeadline(t time.Time) error

func (*StdioConn) String

func (sc *StdioConn) String() string

func (*StdioConn) Write

func (sc *StdioConn) Write(b []byte) (int, error)

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) Accept

func (sl *StdioListener) Accept() (net.Conn, error)

func (*StdioListener) Addr

func (sl *StdioListener) Addr() net.Addr

func (*StdioListener) Close

func (sl *StdioListener) Close() error

Jump to

Keyboard shortcuts

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