Documentation
¶
Overview ¶
Package nntpcli is a generated GoMock package.
Package nntp provides base NNTP definitions.
Package nntpcli is a generated GoMock package.
Index ¶
- Constants
- Variables
- func IsArticleNotFoundError(err error) bool
- type Article
- type Client
- type Config
- type Connection
- type DialConfig
- type Group
- type MockClient
- type MockClientMockRecorder
- type MockConnection
- func (m *MockConnection) Authenticate(username, password string) error
- func (m *MockConnection) BodyDecoded(msgID string, w io.Writer, discard int64) (int64, error)
- func (m *MockConnection) Capabilities() ([]string, error)
- func (m *MockConnection) Close() error
- func (m *MockConnection) CurrentJoinedGroup() string
- func (m *MockConnection) EXPECT() *MockConnectionMockRecorder
- func (m *MockConnection) JoinGroup(name string) error
- func (m *MockConnection) MaxAgeTime() time.Time
- func (m *MockConnection) Post(r io.Reader) error
- func (m *MockConnection) Stat(msgID string) (int, error)
- type MockConnectionMockRecorder
- func (mr *MockConnectionMockRecorder) Authenticate(username, password any) *gomock.Call
- func (mr *MockConnectionMockRecorder) BodyDecoded(msgID, w, discard any) *gomock.Call
- func (mr *MockConnectionMockRecorder) Capabilities() *gomock.Call
- func (mr *MockConnectionMockRecorder) Close() *gomock.Call
- func (mr *MockConnectionMockRecorder) CurrentJoinedGroup() *gomock.Call
- func (mr *MockConnectionMockRecorder) JoinGroup(name any) *gomock.Call
- func (mr *MockConnectionMockRecorder) MaxAgeTime() *gomock.Call
- func (mr *MockConnectionMockRecorder) Post(r any) *gomock.Call
- func (mr *MockConnectionMockRecorder) Stat(msgID any) *gomock.Call
- type Option
- type PostingStatus
- type TimeData
Constants ¶
const ( Unknown = PostingStatus(0) PostingPermitted = PostingStatus('y') PostingNotPermitted = PostingStatus('n') PostingModerated = PostingStatus('m') )
PostingStatus values.
const ( SegmentAlreadyExistsErrCode = 441 ToManyConnectionsErrCode = 502 CanNotJoinGroup = 411 ArticleNotFoundErrCode = 430 )
const NumberOfStatResParams = 3
Variables ¶
Functions ¶
func IsArticleNotFoundError ¶
Types ¶
type Article ¶
type Article struct { // The article's headers Header textproto.MIMEHeader // The article's body Body io.Reader // Number of bytes in the article body (used by OVER/XOVER) Bytes int // Number of lines in the article body (used by OVER/XOVER) Lines int }
An Article that may appear in one or more groups.
type Client ¶
type Client interface { Dial( ctx context.Context, host string, port int, config ...DialConfig, ) (Connection, error) DialTLS( ctx context.Context, host string, port int, insecureSSL bool, config ...DialConfig, ) (Connection, error) }
type Connection ¶
type Connection interface { io.Closer Authenticate(username, password string) (err error) JoinGroup(name string) error BodyDecoded(msgID string, w io.Writer, discard int64) (int64, error) Post(r io.Reader) error CurrentJoinedGroup() string MaxAgeTime() time.Time Stat(msgID string) (int, error) Capabilities() ([]string, error) }
type DialConfig ¶ added in v0.5.0
type Group ¶
type Group struct { Name string Description string Count int64 High int64 Low int64 Posting PostingStatus }
Group represents a usenet newsgroup.
type MockClient ¶
type MockClient struct {
// contains filtered or unexported fields
}
MockClient is a mock of Client interface.
func NewMockClient ¶
func NewMockClient(ctrl *gomock.Controller) *MockClient
NewMockClient creates a new mock instance.
func (*MockClient) Dial ¶
func (m *MockClient) Dial(ctx context.Context, host string, port int, config ...DialConfig) (Connection, error)
Dial mocks base method.
func (*MockClient) DialTLS ¶
func (m *MockClient) DialTLS(ctx context.Context, host string, port int, insecureSSL bool, config ...DialConfig) (Connection, error)
DialTLS mocks base method.
func (*MockClient) EXPECT ¶
func (m *MockClient) EXPECT() *MockClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockClientMockRecorder ¶
type MockClientMockRecorder struct {
// contains filtered or unexported fields
}
MockClientMockRecorder is the mock recorder for MockClient.
type MockConnection ¶
type MockConnection struct {
// contains filtered or unexported fields
}
MockConnection is a mock of Connection interface.
func NewMockConnection ¶
func NewMockConnection(ctrl *gomock.Controller) *MockConnection
NewMockConnection creates a new mock instance.
func (*MockConnection) Authenticate ¶
func (m *MockConnection) Authenticate(username, password string) error
Authenticate mocks base method.
func (*MockConnection) BodyDecoded ¶
BodyDecoded mocks base method.
func (*MockConnection) Capabilities ¶
func (m *MockConnection) Capabilities() ([]string, error)
Capabilities mocks base method.
func (*MockConnection) CurrentJoinedGroup ¶
func (m *MockConnection) CurrentJoinedGroup() string
CurrentJoinedGroup mocks base method.
func (*MockConnection) EXPECT ¶
func (m *MockConnection) EXPECT() *MockConnectionMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockConnection) JoinGroup ¶
func (m *MockConnection) JoinGroup(name string) error
JoinGroup mocks base method.
func (*MockConnection) MaxAgeTime ¶
func (m *MockConnection) MaxAgeTime() time.Time
MaxAgeTime mocks base method.
type MockConnectionMockRecorder ¶
type MockConnectionMockRecorder struct {
// contains filtered or unexported fields
}
MockConnectionMockRecorder is the mock recorder for MockConnection.
func (*MockConnectionMockRecorder) Authenticate ¶
func (mr *MockConnectionMockRecorder) Authenticate(username, password any) *gomock.Call
Authenticate indicates an expected call of Authenticate.
func (*MockConnectionMockRecorder) BodyDecoded ¶
func (mr *MockConnectionMockRecorder) BodyDecoded(msgID, w, discard any) *gomock.Call
BodyDecoded indicates an expected call of BodyDecoded.
func (*MockConnectionMockRecorder) Capabilities ¶
func (mr *MockConnectionMockRecorder) Capabilities() *gomock.Call
Capabilities indicates an expected call of Capabilities.
func (*MockConnectionMockRecorder) Close ¶
func (mr *MockConnectionMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
func (*MockConnectionMockRecorder) CurrentJoinedGroup ¶
func (mr *MockConnectionMockRecorder) CurrentJoinedGroup() *gomock.Call
CurrentJoinedGroup indicates an expected call of CurrentJoinedGroup.
func (*MockConnectionMockRecorder) JoinGroup ¶
func (mr *MockConnectionMockRecorder) JoinGroup(name any) *gomock.Call
JoinGroup indicates an expected call of JoinGroup.
func (*MockConnectionMockRecorder) MaxAgeTime ¶
func (mr *MockConnectionMockRecorder) MaxAgeTime() *gomock.Call
MaxAgeTime indicates an expected call of MaxAgeTime.
type PostingStatus ¶
type PostingStatus byte
PostingStatus type for groups.
func (PostingStatus) String ¶
func (ps PostingStatus) String() string