Files
go-sam-go/primary.go

29 lines
618 B
Go
Raw Normal View History

2025-02-23 18:45:11 -05:00
// package sam3 wraps the original sam3 API from github.com/go-i2p/sam3
2025-02-23 18:01:43 -05:00
package sam3
import (
"github.com/go-i2p/go-sam-go/primary"
)
const (
session_ADDOK = "SESSION STATUS RESULT=OK"
)
// Represents a primary session.
type PrimarySession struct {
*primary.PrimarySession
}
var PrimarySessionSwitch = "MASTER"
func (p *PrimarySession) NewStreamSubSession(id string) (*StreamSession, error) {
log.WithField("id", id).Debug("NewStreamSubSession called")
session, err := p.PrimarySession.NewStreamSubSession(id)
if err != nil {
return nil, err
}
return &StreamSession{
StreamSession: session,
}, nil
}