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
- func IsRetryableError(err error) bool
- type Article
- type Client
- type Config
- type Connection
- 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 interface{}) *gomock.Call
- func (mr *MockConnectionMockRecorder) BodyDecoded(msgId, w, discard interface{}) *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 interface{}) *gomock.Call
- func (mr *MockConnectionMockRecorder) MaxAgeTime() *gomock.Call
- func (mr *MockConnectionMockRecorder) Post(r interface{}) *gomock.Call
- func (mr *MockConnectionMockRecorder) Stat(msgId interface{}) *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 ArticleNotFoundErrCode = 430
const CanNotJoinGroup = 411
const NumberOfStatResParams = 3
const SegmentAlreadyExistsErrCode = 441
const ToManyConnectionsErrCode = 502
Variables ¶
Functions ¶
func IsArticleNotFoundError ¶
func IsRetryableError ¶
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 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) }
func NewFakeConnection ¶
func NewFakeConnection() Connection
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, maxAgeTime time.Time) (Connection, error)
Dial mocks base method.
func (*MockClient) DialTLS ¶
func (m *MockClient) DialTLS(ctx context.Context, host string, port int, insecureSSL bool, maxAgeTime time.Time) (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.
func (*MockClientMockRecorder) Dial ¶
func (mr *MockClientMockRecorder) Dial(ctx, host, port, maxAgeTime interface{}) *gomock.Call
Dial indicates an expected call of Dial.
func (*MockClientMockRecorder) DialTLS ¶
func (mr *MockClientMockRecorder) DialTLS(ctx, host, port, insecureSSL, maxAgeTime interface{}) *gomock.Call
DialTLS indicates an expected call of DialTLS.
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 interface{}) *gomock.Call
Authenticate indicates an expected call of Authenticate.
func (*MockConnectionMockRecorder) BodyDecoded ¶
func (mr *MockConnectionMockRecorder) BodyDecoded(msgId, w, discard interface{}) *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 interface{}) *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.
func (*MockConnectionMockRecorder) Post ¶
func (mr *MockConnectionMockRecorder) Post(r interface{}) *gomock.Call
Post indicates an expected call of Post.
func (*MockConnectionMockRecorder) Stat ¶
func (mr *MockConnectionMockRecorder) Stat(msgId interface{}) *gomock.Call
Stat indicates an expected call of Stat.
type PostingStatus ¶
type PostingStatus byte
PostingStatus type for groups.
func (PostingStatus) String ¶
func (ps PostingStatus) String() string