remote

package
v0.0.0-...-f12c835 Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Copyright © 2022 Kostas Antonopoulos kost.antonopoulos@gmail.com

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.

Copyright © 2022 Kostas Antonopoulos kost.antonopoulos@gmail.com

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.

Copyright © 2022 Kostas Antonopoulos kost.antonopoulos@gmail.com

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.

Index

Constants

View Source
const DefaultPort = 22

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	Name                 string `mapstructure:"name"`
	Addr                 string `mapstructure:"addr"`
	Port                 int    `mapstructure:"port"`
	AuthenticationMethod string `mapstructure:"authentication_method"`
	User                 string `mapstructure:"user"`
	Pass                 string `mapstructure:"pass"`
	Gateway              string `mapstructure:"gateway"`
	BecomeUser           string `mapstructure:"become_user"`
	// contains filtered or unexported fields
}

func (Server) CloseClient

func (server Server) CloseClient() error

Closes the client

func (*Server) Connect

func (server *Server) Connect() error

Connect to server connects to the server, hopping through all of the servers in the list starting from the last

func (*Server) CreateServerChain

func (server *Server) CreateServerChain(servers map[string]ServerInterface) error

CreateServerChain populates the serverChain field with a list of servers that should be used as gateways server index 0 is the server closest to our Server

func (Server) Download

func (server Server) Download(file, dest string) error

Download file to Server

func (Server) GetName

func (server Server) GetName() string

Getter method for Name field

func (Server) String

func (server Server) String() string

Stringer method for Server struct

func (Server) Upload

func (server Server) Upload(file, dest string) error

Upload file to Server

type ServerInterface

type ServerInterface interface {
	GetName() string
	CreateServerChain(servers map[string]ServerInterface) error
	Connect() error
	CloseClient() error
	Download(file, dest string) error
	Upload(file, dest string) error
}

Jump to

Keyboard shortcuts

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