Rename package gate to portal

This commit is contained in:
Trevor Slocum 2020-02-07 15:03:07 -08:00
parent feee3e0c3f
commit c022148226
3 changed files with 8 additions and 8 deletions

View File

@ -1,5 +1,5 @@
# sshtargate
[![GoDoc](https://gitlab.com/tslocum/godoc-static/-/raw/master/badge.svg)](https://docs.rocketnine.space/gitlab.com/tslocum/sshtargate/pkg/gate)
[![GoDoc](https://gitlab.com/tslocum/godoc-static/-/raw/master/badge.svg)](https://docs.rocketnine.space/gitlab.com/tslocum/sshtargate/portal)
[![CI status](https://gitlab.com/tslocum/sshtargate/badges/master/pipeline.svg)](https://gitlab.com/tslocum/sshtargate/commits/master)
[![Donate](https://img.shields.io/liberapay/receives/rocketnine.space.svg?logo=liberapay)](https://liberapay.com/rocketnine.space)

View File

@ -12,7 +12,7 @@ import (
"syscall"
"github.com/anmitsu/go-shlex"
"gitlab.com/tslocum/sshtargate/pkg/gate"
"gitlab.com/tslocum/sshtargate/portal"
)
const (
@ -29,7 +29,7 @@ var (
printVersionInfo bool
configPath string
portals []*gate.Portal
portals []*portal.Portal
portalsLock = new(sync.Mutex)
done = make(chan bool)
@ -87,7 +87,7 @@ func main() {
address := address // Capture
go func() {
p, err := gate.NewPortal(pname, address, cs)
p, err := portal.New(pname, address, cs)
if err != nil {
log.Fatalf("failed to start portal %s on %s: %s", pname, address, err)
}

View File

@ -1,5 +1,5 @@
// Package gate provides SSH portals to applications.
package gate
// Package portal provides SSH portals to applications.
package portal
import (
"context"
@ -35,8 +35,8 @@ type Portal struct {
Server *ssh.Server
}
// NewPortal opens an SSH portal to an application.
func NewPortal(name string, address string, command []string) (*Portal, error) {
// New opens an SSH portal to an application.
func New(name string, address string, command []string) (*Portal, error) {
if address == "" {
return nil, errors.New("no address supplied")
} else if command == nil || command[0] == "" {