Documentation
¶
Index ¶
- Variables
- type CloseableRepository
- type Environment
- type FindOpts
- type LocalRepository
- func (this *LocalRepository) Close() error
- func (this *LocalRepository) DoesSupportPty(Request, ssh.Pty) (bool, error)
- func (this *LocalRepository) Ensure(req Request) (Environment, error)
- func (this *LocalRepository) FindBySession(ctx context.Context, sess session.Session, opts *FindOpts) (Environment, error)
- func (this *LocalRepository) WillBeAccepted(req Request) (ok bool, err error)
- type Repository
- type RepositoryFacade
- func (this *RepositoryFacade) Close() (rErr error)
- func (this *RepositoryFacade) DoesSupportPty(req Request, pty ssh.Pty) (bool, error)
- func (this *RepositoryFacade) Ensure(req Request) (Environment, error)
- func (this *RepositoryFacade) FindBySession(ctx context.Context, sess session.Session, opts *FindOpts) (Environment, error)
- func (this *RepositoryFacade) WillBeAccepted(req Request) (bool, error)
- type RepositoryFactory
- type Request
- type Task
- type TaskType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoSuchEnvironment = errors.New("no such environment") ErrNotAcceptable = errors.New("not acceptable") )
Functions ¶
This section is empty.
Types ¶
type CloseableRepository ¶
type CloseableRepository interface {
Repository
io.Closer
}
type Environment ¶
type Environment interface {
Session() session.Session
Banner(Request) (io.ReadCloser, error)
Run(Task) (int, error)
IsPortForwardingAllowed(host string, port uint32) (bool, error)
NewDestinationConnection(ctx context.Context, host string, port uint32) (io.ReadWriteCloser, error)
Dispose(context.Context) (bool, error)
}
type FindOpts ¶
type FindOpts struct {
// AutoCleanUpAllowed tells the repository to clean up everything
// automatically while executing the search. The requester will never
// see the requested result. This is false by default because it could
// lead to quite performance impacts or other unwanted side effects.
//
// Therefore: Use with caution.
AutoCleanUpAllowed *bool
// Logger will be used (if any log is required) instead of the standard logger.
Logger log.Logger
}
FindOpts adds some more hints what should happen when find methods of Repository are executed.
func (*FindOpts) IsAutoCleanUpAllowed ¶
type LocalRepository ¶
func NewLocalRepository ¶
func NewLocalRepository(ctx context.Context, flow configuration.FlowName, conf *configuration.EnvironmentLocal) (*LocalRepository, error)
func (*LocalRepository) Close ¶
func (this *LocalRepository) Close() error
func (*LocalRepository) DoesSupportPty ¶ added in v0.2.0
func (*LocalRepository) Ensure ¶
func (this *LocalRepository) Ensure(req Request) (Environment, error)
func (*LocalRepository) FindBySession ¶
func (this *LocalRepository) FindBySession(ctx context.Context, sess session.Session, opts *FindOpts) (Environment, error)
func (*LocalRepository) WillBeAccepted ¶
func (this *LocalRepository) WillBeAccepted(req Request) (ok bool, err error)
type Repository ¶
type Repository interface {
// WillBeAccepted returns true if it is possible to get an Environment for the
// provided Request.
WillBeAccepted(Request) (bool, error)
// DoesSupportPty will return true if the resulting Environment will support
// an PTY.
DoesSupportPty(Request, ssh.Pty) (bool, error)
// Ensure will create or return an environment that matches the given Request.
// If it is not acceptable to do this action with the provided Request
// ErrNotAcceptable is returned; you can call WillBeAccepted to prevent such
// errors.
Ensure(Request) (Environment, error)
// FindBySession will find an existing environment for a given session.Session.
// If there is no matching one ErrNoSuchEnvironment will be returned.
FindBySession(context.Context, session.Session, *FindOpts) (Environment, error)
}
type RepositoryFacade ¶
type RepositoryFacade struct {
// contains filtered or unexported fields
}
func NewRepositoryFacade ¶
func NewRepositoryFacade(ctx context.Context, flows *configuration.Flows) (*RepositoryFacade, error)
func (*RepositoryFacade) Close ¶
func (this *RepositoryFacade) Close() (rErr error)
func (*RepositoryFacade) DoesSupportPty ¶ added in v0.2.0
func (*RepositoryFacade) Ensure ¶
func (this *RepositoryFacade) Ensure(req Request) (Environment, error)
func (*RepositoryFacade) FindBySession ¶
func (this *RepositoryFacade) FindBySession(ctx context.Context, sess session.Session, opts *FindOpts) (Environment, error)
func (*RepositoryFacade) WillBeAccepted ¶
func (this *RepositoryFacade) WillBeAccepted(req Request) (bool, error)
type RepositoryFactory ¶ added in v0.2.0
type RepositoryFactory[C any, R CloseableRepository] func(ctx context.Context, flow configuration.FlowName, conf C) (R, error)
func RegisterRepository ¶ added in v0.2.0
func RegisterRepository[C any, R CloseableRepository](factory RepositoryFactory[C, R]) RepositoryFactory[C, R]
type Request ¶
type Request interface {
Remote() common.Remote
Context() ssh.Context
Logger() log.Logger
Authorization() authorization.Authorization
}
Click to show internal directories.
Click to hide internal directories.