Documentation ¶
Overview ¶
Package server implements GRPC-server upon gnetcli library.
Index ¶
- Variables
- func BuildCreds(login, password string, enableAgent bool, logger *zap.Logger) credentials.Credentials
- func BuildEmptyCreds(logger *zap.Logger) credentials.Credentials
- func MakeFileResult(path string, file streamer.File) *pb.FileData
- type Auth
- type Config
- type LogConfig
- type MultiTrace
- type MultiTraceImp
- type Option
- type Server
- func (m *Server) AddDevice(ctx context.Context, device *pb.Device) (*pb.DeviceResult, error)
- func (m *Server) Download(ctx context.Context, req *pb.FileDownloadRequest) (*pb.FilesResult, error)
- func (m *Server) Exec(ctx context.Context, cmd *pb.CMD) (*pb.CMDResult, error)
- func (m *Server) ExecChat(stream pb.Gnetcli_ExecChatServer) error
- func (m *Server) SetupHostParams(ctx context.Context, hostParams *pb.HostParams) (*emptypb.Empty, error)
- func (m *Server) Upload(ctx context.Context, req *pb.FileUploadRequest) (*emptypb.Empty, error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func BuildCreds ¶
func BuildCreds(login, password string, enableAgent bool, logger *zap.Logger) credentials.Credentials
func BuildEmptyCreds ¶ added in v1.0.1
func BuildEmptyCreds(logger *zap.Logger) credentials.Credentials
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
func NewAuthInsecure ¶
func (*Auth) AuthenticateStream ¶
func (m *Auth) AuthenticateStream(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error
func (*Auth) AuthenticateUnary ¶
func (m *Auth) AuthenticateUnary(ctx context.Context, req interface{}, servInfo *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
type Config ¶ added in v1.0.27
type Config struct { Logging LogConfig `yaml:"logging"` Port int `config:"port,description=Server port" yaml:"port"` DevLogin string `config:"dev-login,description=Default device login" yaml:"dev_login"` DevPass string `config:"dev-pass,description=Default device password" yaml:"dev_pass"` DevUseAgent bool `config:"dev-use-agent" yaml:"dev_use_agent"` ConfFile string `config:"conf-file,description=Path to config file"` Tls bool `config:"tls,description=Connection uses TLS if true, else plain TCP" yaml:"tls"` CertFile string `config:"cert-file,description=The TLS cert file" yaml:"cert_file"` KeyFile string `config:"key-file,description=The TLS key file" yaml:"key_file"` BasicAuth string `config:"basic-auth,description=Authenticate client using Basic auth" yaml:"basic_auth"` DisableTcp bool `config:"disable_tcp,description=Disable TCP listener" yaml:"disable_tcp"` UnixSocket string `config:"unix-socket,description=Unix socket path" yaml:"unix_socket"` Debug bool `config:"debug,short=d,description=Set debug log level"` }
type MultiTraceImp ¶
type MultiTraceImp struct {
// contains filtered or unexported fields
}
func NewMultiTrace ¶
func NewMultiTrace() *MultiTraceImp
func (*MultiTraceImp) DelTrace ¶
func (m *MultiTraceImp) DelTrace(index int) error
func (*MultiTraceImp) List ¶
func (m *MultiTraceImp) List() []gtrace.Item
type Option ¶
type Option func(*Server)
func WithDefaultDeviceCredentials ¶ added in v1.0.27
func WithDefaultDeviceCredentials(creds credentials.Credentials) Option
func WithLogger ¶
type Server ¶
type Server struct { pb.UnimplementedGnetcliServer // contains filtered or unexported fields }
func (*Server) Download ¶ added in v1.0.4
func (m *Server) Download(ctx context.Context, req *pb.FileDownloadRequest) (*pb.FilesResult, error)
func (*Server) SetupHostParams ¶ added in v1.0.4
Click to show internal directories.
Click to hide internal directories.