Browse Source

Rename package gate to portal

master
Trevor Slocum 2 years ago
parent
commit
c022148226
  1. 2
      README.md
  2. 6
      main.go
  3. 8
      portal/portal.go

2
README.md

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

6
main.go

@ -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)
}

8
pkg/gate/portal.go → portal/portal.go

@ -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] == "" {
Loading…
Cancel
Save