gproxy

package module
v0.0.0-...-2873319 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

README

Proxy-gRPC

Сервис proxy используя gRPC
gRPC methods:
  • CreateProxy - add new proxy to db

  • NewProxyList - add multiple new proxy to db

  • BestProxy - get proxy for use

  • NextProxy - get proxy for use

  • NewStat - get proxy for use

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthProxy        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowProxy          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupProxy = fmt.Errorf("proto: unexpected end of group")
)
View Source
var ErrNoRows = errors.New("no rows in result set")
View Source
var ErrQueryTooOften = errors.New("query too often, need to wait")

Functions

func RegisterProxyServer

func RegisterProxyServer(s *grpc.Server, srv ProxyServer)

Types

type CreateProxyRequest

type CreateProxyRequest struct {
	ProxyItem *ProxyItem `protobuf:"bytes,1,opt,name=proxy_item,json=proxyItem,proto3" json:"proxy_item,omitempty"`
}

func NewPopulatedCreateProxyRequest

func NewPopulatedCreateProxyRequest(r randyProxy, easy bool) *CreateProxyRequest

func (*CreateProxyRequest) Descriptor

func (*CreateProxyRequest) Descriptor() ([]byte, []int)

func (*CreateProxyRequest) Equal

func (this *CreateProxyRequest) Equal(that interface{}) bool

func (*CreateProxyRequest) GetProxyItem

func (m *CreateProxyRequest) GetProxyItem() *ProxyItem

func (*CreateProxyRequest) GoString

func (this *CreateProxyRequest) GoString() string

func (*CreateProxyRequest) Marshal

func (m *CreateProxyRequest) Marshal() (dAtA []byte, err error)

func (*CreateProxyRequest) MarshalTo

func (m *CreateProxyRequest) MarshalTo(dAtA []byte) (int, error)

func (*CreateProxyRequest) MarshalToSizedBuffer

func (m *CreateProxyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*CreateProxyRequest) ProtoMessage

func (*CreateProxyRequest) ProtoMessage()

func (*CreateProxyRequest) Reset

func (m *CreateProxyRequest) Reset()

func (*CreateProxyRequest) Size

func (m *CreateProxyRequest) Size() (n int)

func (*CreateProxyRequest) String

func (this *CreateProxyRequest) String() string

func (*CreateProxyRequest) Unmarshal

func (m *CreateProxyRequest) Unmarshal(dAtA []byte) error

func (*CreateProxyRequest) XXX_DiscardUnknown

func (m *CreateProxyRequest) XXX_DiscardUnknown()

func (*CreateProxyRequest) XXX_Marshal

func (m *CreateProxyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CreateProxyRequest) XXX_Merge

func (m *CreateProxyRequest) XXX_Merge(src proto.Message)

func (*CreateProxyRequest) XXX_Size

func (m *CreateProxyRequest) XXX_Size() int

func (*CreateProxyRequest) XXX_Unmarshal

func (m *CreateProxyRequest) XXX_Unmarshal(b []byte) error

type CreateProxyResponse

type CreateProxyResponse struct {
	ProxyItem *ProxyItem `protobuf:"bytes,1,opt,name=proxy_item,json=proxyItem,proto3" json:"proxy_item,omitempty"`
}

func NewPopulatedCreateProxyResponse

func NewPopulatedCreateProxyResponse(r randyProxy, easy bool) *CreateProxyResponse

func (*CreateProxyResponse) Descriptor

func (*CreateProxyResponse) Descriptor() ([]byte, []int)

func (*CreateProxyResponse) Equal

func (this *CreateProxyResponse) Equal(that interface{}) bool

func (*CreateProxyResponse) GetProxyItem

func (m *CreateProxyResponse) GetProxyItem() *ProxyItem

func (*CreateProxyResponse) GoString

func (this *CreateProxyResponse) GoString() string

func (*CreateProxyResponse) Marshal

func (m *CreateProxyResponse) Marshal() (dAtA []byte, err error)

func (*CreateProxyResponse) MarshalTo

func (m *CreateProxyResponse) MarshalTo(dAtA []byte) (int, error)

func (*CreateProxyResponse) MarshalToSizedBuffer

func (m *CreateProxyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*CreateProxyResponse) ProtoMessage

func (*CreateProxyResponse) ProtoMessage()

func (*CreateProxyResponse) Reset

func (m *CreateProxyResponse) Reset()

func (*CreateProxyResponse) Size

func (m *CreateProxyResponse) Size() (n int)

func (*CreateProxyResponse) String

func (this *CreateProxyResponse) String() string

func (*CreateProxyResponse) Unmarshal

func (m *CreateProxyResponse) Unmarshal(dAtA []byte) error

func (*CreateProxyResponse) XXX_DiscardUnknown

func (m *CreateProxyResponse) XXX_DiscardUnknown()

func (*CreateProxyResponse) XXX_Marshal

func (m *CreateProxyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CreateProxyResponse) XXX_Merge

func (m *CreateProxyResponse) XXX_Merge(src proto.Message)

func (*CreateProxyResponse) XXX_Size

func (m *CreateProxyResponse) XXX_Size() int

func (*CreateProxyResponse) XXX_Unmarshal

func (m *CreateProxyResponse) XXX_Unmarshal(b []byte) error

type CreateProxyStatRequest

type CreateProxyStatRequest struct {
	ProxyStat *ProxyStat `protobuf:"bytes,1,opt,name=proxy_stat,json=proxyStat,proto3" json:"proxy_stat,omitempty"`
}

func NewPopulatedCreateProxyStatRequest

func NewPopulatedCreateProxyStatRequest(r randyProxy, easy bool) *CreateProxyStatRequest

func (*CreateProxyStatRequest) Descriptor

func (*CreateProxyStatRequest) Descriptor() ([]byte, []int)

func (*CreateProxyStatRequest) Equal

func (this *CreateProxyStatRequest) Equal(that interface{}) bool

func (*CreateProxyStatRequest) GetProxyStat

func (m *CreateProxyStatRequest) GetProxyStat() *ProxyStat

func (*CreateProxyStatRequest) GoString

func (this *CreateProxyStatRequest) GoString() string

func (*CreateProxyStatRequest) Marshal

func (m *CreateProxyStatRequest) Marshal() (dAtA []byte, err error)

func (*CreateProxyStatRequest) MarshalTo

func (m *CreateProxyStatRequest) MarshalTo(dAtA []byte) (int, error)

func (*CreateProxyStatRequest) MarshalToSizedBuffer

func (m *CreateProxyStatRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*CreateProxyStatRequest) ProtoMessage

func (*CreateProxyStatRequest) ProtoMessage()

func (*CreateProxyStatRequest) Reset

func (m *CreateProxyStatRequest) Reset()

func (*CreateProxyStatRequest) Size

func (m *CreateProxyStatRequest) Size() (n int)

func (*CreateProxyStatRequest) String

func (this *CreateProxyStatRequest) String() string

func (*CreateProxyStatRequest) Unmarshal

func (m *CreateProxyStatRequest) Unmarshal(dAtA []byte) error

func (*CreateProxyStatRequest) XXX_DiscardUnknown

func (m *CreateProxyStatRequest) XXX_DiscardUnknown()

func (*CreateProxyStatRequest) XXX_Marshal

func (m *CreateProxyStatRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CreateProxyStatRequest) XXX_Merge

func (m *CreateProxyStatRequest) XXX_Merge(src proto.Message)

func (*CreateProxyStatRequest) XXX_Size

func (m *CreateProxyStatRequest) XXX_Size() int

func (*CreateProxyStatRequest) XXX_Unmarshal

func (m *CreateProxyStatRequest) XXX_Unmarshal(b []byte) error

type CreateProxyStatResponse

type CreateProxyStatResponse struct {
	ProxyStat *ProxyStat `protobuf:"bytes,1,opt,name=proxy_stat,json=proxyStat,proto3" json:"proxy_stat,omitempty"`
}

func NewPopulatedCreateProxyStatResponse

func NewPopulatedCreateProxyStatResponse(r randyProxy, easy bool) *CreateProxyStatResponse

func (*CreateProxyStatResponse) Descriptor

func (*CreateProxyStatResponse) Descriptor() ([]byte, []int)

func (*CreateProxyStatResponse) Equal

func (this *CreateProxyStatResponse) Equal(that interface{}) bool

func (*CreateProxyStatResponse) GetProxyStat

func (m *CreateProxyStatResponse) GetProxyStat() *ProxyStat

func (*CreateProxyStatResponse) GoString

func (this *CreateProxyStatResponse) GoString() string

func (*CreateProxyStatResponse) Marshal

func (m *CreateProxyStatResponse) Marshal() (dAtA []byte, err error)

func (*CreateProxyStatResponse) MarshalTo

func (m *CreateProxyStatResponse) MarshalTo(dAtA []byte) (int, error)

func (*CreateProxyStatResponse) MarshalToSizedBuffer

func (m *CreateProxyStatResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*CreateProxyStatResponse) ProtoMessage

func (*CreateProxyStatResponse) ProtoMessage()

func (*CreateProxyStatResponse) Reset

func (m *CreateProxyStatResponse) Reset()

func (*CreateProxyStatResponse) Size

func (m *CreateProxyStatResponse) Size() (n int)

func (*CreateProxyStatResponse) String

func (this *CreateProxyStatResponse) String() string

func (*CreateProxyStatResponse) Unmarshal

func (m *CreateProxyStatResponse) Unmarshal(dAtA []byte) error

func (*CreateProxyStatResponse) XXX_DiscardUnknown

func (m *CreateProxyStatResponse) XXX_DiscardUnknown()

func (*CreateProxyStatResponse) XXX_Marshal

func (m *CreateProxyStatResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CreateProxyStatResponse) XXX_Merge

func (m *CreateProxyStatResponse) XXX_Merge(src proto.Message)

func (*CreateProxyStatResponse) XXX_Size

func (m *CreateProxyStatResponse) XXX_Size() int

func (*CreateProxyStatResponse) XXX_Unmarshal

func (m *CreateProxyStatResponse) XXX_Unmarshal(b []byte) error

type GetBestProxyRequest

type GetBestProxyRequest struct {
}

func NewPopulatedGetBestProxyRequest

func NewPopulatedGetBestProxyRequest(r randyProxy, easy bool) *GetBestProxyRequest

func (*GetBestProxyRequest) Descriptor

func (*GetBestProxyRequest) Descriptor() ([]byte, []int)

func (*GetBestProxyRequest) Equal

func (this *GetBestProxyRequest) Equal(that interface{}) bool

func (*GetBestProxyRequest) GoString

func (this *GetBestProxyRequest) GoString() string

func (*GetBestProxyRequest) Marshal

func (m *GetBestProxyRequest) Marshal() (dAtA []byte, err error)

func (*GetBestProxyRequest) MarshalTo

func (m *GetBestProxyRequest) MarshalTo(dAtA []byte) (int, error)

func (*GetBestProxyRequest) MarshalToSizedBuffer

func (m *GetBestProxyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GetBestProxyRequest) ProtoMessage

func (*GetBestProxyRequest) ProtoMessage()

func (*GetBestProxyRequest) Reset

func (m *GetBestProxyRequest) Reset()

func (*GetBestProxyRequest) Size

func (m *GetBestProxyRequest) Size() (n int)

func (*GetBestProxyRequest) String

func (this *GetBestProxyRequest) String() string

func (*GetBestProxyRequest) Unmarshal

func (m *GetBestProxyRequest) Unmarshal(dAtA []byte) error

func (*GetBestProxyRequest) XXX_DiscardUnknown

func (m *GetBestProxyRequest) XXX_DiscardUnknown()

func (*GetBestProxyRequest) XXX_Marshal

func (m *GetBestProxyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetBestProxyRequest) XXX_Merge

func (m *GetBestProxyRequest) XXX_Merge(src proto.Message)

func (*GetBestProxyRequest) XXX_Size

func (m *GetBestProxyRequest) XXX_Size() int

func (*GetBestProxyRequest) XXX_Unmarshal

func (m *GetBestProxyRequest) XXX_Unmarshal(b []byte) error

type GetBestProxyResponse

type GetBestProxyResponse struct {
	ProxyItem *ProxyItem `protobuf:"bytes,1,opt,name=proxy_item,json=proxyItem,proto3" json:"proxy_item,omitempty"`
}

func NewPopulatedGetBestProxyResponse

func NewPopulatedGetBestProxyResponse(r randyProxy, easy bool) *GetBestProxyResponse

func (*GetBestProxyResponse) Descriptor

func (*GetBestProxyResponse) Descriptor() ([]byte, []int)

func (*GetBestProxyResponse) Equal

func (this *GetBestProxyResponse) Equal(that interface{}) bool

func (*GetBestProxyResponse) GetProxyItem

func (m *GetBestProxyResponse) GetProxyItem() *ProxyItem

func (*GetBestProxyResponse) GoString

func (this *GetBestProxyResponse) GoString() string

func (*GetBestProxyResponse) Marshal

func (m *GetBestProxyResponse) Marshal() (dAtA []byte, err error)

func (*GetBestProxyResponse) MarshalTo

func (m *GetBestProxyResponse) MarshalTo(dAtA []byte) (int, error)

func (*GetBestProxyResponse) MarshalToSizedBuffer

func (m *GetBestProxyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GetBestProxyResponse) ProtoMessage

func (*GetBestProxyResponse) ProtoMessage()

func (*GetBestProxyResponse) Reset

func (m *GetBestProxyResponse) Reset()

func (*GetBestProxyResponse) Size

func (m *GetBestProxyResponse) Size() (n int)

func (*GetBestProxyResponse) String

func (this *GetBestProxyResponse) String() string

func (*GetBestProxyResponse) Unmarshal

func (m *GetBestProxyResponse) Unmarshal(dAtA []byte) error

func (*GetBestProxyResponse) XXX_DiscardUnknown

func (m *GetBestProxyResponse) XXX_DiscardUnknown()

func (*GetBestProxyResponse) XXX_Marshal

func (m *GetBestProxyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetBestProxyResponse) XXX_Merge

func (m *GetBestProxyResponse) XXX_Merge(src proto.Message)

func (*GetBestProxyResponse) XXX_Size

func (m *GetBestProxyResponse) XXX_Size() int

func (*GetBestProxyResponse) XXX_Unmarshal

func (m *GetBestProxyResponse) XXX_Unmarshal(b []byte) error

type GetNextProxyRequest

type GetNextProxyRequest struct {
}

func NewPopulatedGetNextProxyRequest

func NewPopulatedGetNextProxyRequest(r randyProxy, easy bool) *GetNextProxyRequest

func (*GetNextProxyRequest) Descriptor

func (*GetNextProxyRequest) Descriptor() ([]byte, []int)

func (*GetNextProxyRequest) Equal

func (this *GetNextProxyRequest) Equal(that interface{}) bool

func (*GetNextProxyRequest) GoString

func (this *GetNextProxyRequest) GoString() string

func (*GetNextProxyRequest) Marshal

func (m *GetNextProxyRequest) Marshal() (dAtA []byte, err error)

func (*GetNextProxyRequest) MarshalTo

func (m *GetNextProxyRequest) MarshalTo(dAtA []byte) (int, error)

func (*GetNextProxyRequest) MarshalToSizedBuffer

func (m *GetNextProxyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GetNextProxyRequest) ProtoMessage

func (*GetNextProxyRequest) ProtoMessage()

func (*GetNextProxyRequest) Reset

func (m *GetNextProxyRequest) Reset()

func (*GetNextProxyRequest) Size

func (m *GetNextProxyRequest) Size() (n int)

func (*GetNextProxyRequest) String

func (this *GetNextProxyRequest) String() string

func (*GetNextProxyRequest) Unmarshal

func (m *GetNextProxyRequest) Unmarshal(dAtA []byte) error

func (*GetNextProxyRequest) XXX_DiscardUnknown

func (m *GetNextProxyRequest) XXX_DiscardUnknown()

func (*GetNextProxyRequest) XXX_Marshal

func (m *GetNextProxyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetNextProxyRequest) XXX_Merge

func (m *GetNextProxyRequest) XXX_Merge(src proto.Message)

func (*GetNextProxyRequest) XXX_Size

func (m *GetNextProxyRequest) XXX_Size() int

func (*GetNextProxyRequest) XXX_Unmarshal

func (m *GetNextProxyRequest) XXX_Unmarshal(b []byte) error

type GetNextProxyResponse

type GetNextProxyResponse struct {
	ProxyItem *ProxyItem `protobuf:"bytes,1,opt,name=proxy_item,json=proxyItem,proto3" json:"proxy_item,omitempty"`
}

func NewPopulatedGetNextProxyResponse

func NewPopulatedGetNextProxyResponse(r randyProxy, easy bool) *GetNextProxyResponse

func (*GetNextProxyResponse) Descriptor

func (*GetNextProxyResponse) Descriptor() ([]byte, []int)

func (*GetNextProxyResponse) Equal

func (this *GetNextProxyResponse) Equal(that interface{}) bool

func (*GetNextProxyResponse) GetProxyItem

func (m *GetNextProxyResponse) GetProxyItem() *ProxyItem

func (*GetNextProxyResponse) GoString

func (this *GetNextProxyResponse) GoString() string

func (*GetNextProxyResponse) Marshal

func (m *GetNextProxyResponse) Marshal() (dAtA []byte, err error)

func (*GetNextProxyResponse) MarshalTo

func (m *GetNextProxyResponse) MarshalTo(dAtA []byte) (int, error)

func (*GetNextProxyResponse) MarshalToSizedBuffer

func (m *GetNextProxyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GetNextProxyResponse) ProtoMessage

func (*GetNextProxyResponse) ProtoMessage()

func (*GetNextProxyResponse) Reset

func (m *GetNextProxyResponse) Reset()

func (*GetNextProxyResponse) Size

func (m *GetNextProxyResponse) Size() (n int)

func (*GetNextProxyResponse) String

func (this *GetNextProxyResponse) String() string

func (*GetNextProxyResponse) Unmarshal

func (m *GetNextProxyResponse) Unmarshal(dAtA []byte) error

func (*GetNextProxyResponse) XXX_DiscardUnknown

func (m *GetNextProxyResponse) XXX_DiscardUnknown()

func (*GetNextProxyResponse) XXX_Marshal

func (m *GetNextProxyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetNextProxyResponse) XXX_Merge

func (m *GetNextProxyResponse) XXX_Merge(src proto.Message)

func (*GetNextProxyResponse) XXX_Size

func (m *GetNextProxyResponse) XXX_Size() int

func (*GetNextProxyResponse) XXX_Unmarshal

func (m *GetNextProxyResponse) XXX_Unmarshal(b []byte) error

type ProxyClient

type ProxyClient interface {
	CreateProxy(ctx context.Context, in *CreateProxyRequest, opts ...grpc.CallOption) (*CreateProxyResponse, error)
	CreateProxyStat(ctx context.Context, in *CreateProxyStatRequest, opts ...grpc.CallOption) (*CreateProxyStatResponse, error)
	GetNextProxy(ctx context.Context, in *GetNextProxyRequest, opts ...grpc.CallOption) (*GetNextProxyResponse, error)
	GetBestProxy(ctx context.Context, in *GetBestProxyRequest, opts ...grpc.CallOption) (*GetBestProxyResponse, error)
}

ProxyClient is the client API for Proxy service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewProxyClient

func NewProxyClient(cc *grpc.ClientConn) ProxyClient

type ProxyCountry

type ProxyCountry struct {
	CountryId   int64      `protobuf:"varint,1,opt,name=country_id,json=countryId,proto3" json:"country_id,omitempty"`
	CountryName string     `protobuf:"bytes,2,opt,name=country_name,json=countryName,proto3" json:"country_name,omitempty"`
	CountryCode string     `protobuf:"bytes,3,opt,name=country_code,json=countryCode,proto3" json:"country_code,omitempty"`
	CreatedAt   *time.Time `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at,omitempty"`
}

func NewPopulatedProxyCountry

func NewPopulatedProxyCountry(r randyProxy, easy bool) *ProxyCountry

func (*ProxyCountry) Descriptor

func (*ProxyCountry) Descriptor() ([]byte, []int)

func (*ProxyCountry) Equal

func (this *ProxyCountry) Equal(that interface{}) bool

func (*ProxyCountry) GetCountryCode

func (m *ProxyCountry) GetCountryCode() string

func (*ProxyCountry) GetCountryId

func (m *ProxyCountry) GetCountryId() int64

func (*ProxyCountry) GetCountryName

func (m *ProxyCountry) GetCountryName() string

func (*ProxyCountry) GetCreatedAt

func (m *ProxyCountry) GetCreatedAt() *time.Time

func (*ProxyCountry) GoString

func (this *ProxyCountry) GoString() string

func (*ProxyCountry) Marshal

func (m *ProxyCountry) Marshal() (dAtA []byte, err error)

func (*ProxyCountry) MarshalTo

func (m *ProxyCountry) MarshalTo(dAtA []byte) (int, error)

func (*ProxyCountry) MarshalToSizedBuffer

func (m *ProxyCountry) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ProxyCountry) ProtoMessage

func (*ProxyCountry) ProtoMessage()

func (*ProxyCountry) Reset

func (m *ProxyCountry) Reset()

func (*ProxyCountry) Size

func (m *ProxyCountry) Size() (n int)

func (*ProxyCountry) String

func (this *ProxyCountry) String() string

func (*ProxyCountry) Unmarshal

func (m *ProxyCountry) Unmarshal(dAtA []byte) error

func (*ProxyCountry) XXX_DiscardUnknown

func (m *ProxyCountry) XXX_DiscardUnknown()

func (*ProxyCountry) XXX_Marshal

func (m *ProxyCountry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ProxyCountry) XXX_Merge

func (m *ProxyCountry) XXX_Merge(src proto.Message)

func (*ProxyCountry) XXX_Size

func (m *ProxyCountry) XXX_Size() int

func (*ProxyCountry) XXX_Unmarshal

func (m *ProxyCountry) XXX_Unmarshal(b []byte) error

type ProxyItem

type ProxyItem struct {
	ProxyId      int64         `protobuf:"varint,1,opt,name=proxy_id,json=proxyId,proto3" json:"proxy_id,omitempty"`
	ProxyIp      string        `protobuf:"bytes,2,opt,name=proxy_ip,json=proxyIp,proto3" json:"proxy_ip,omitempty"`
	ProxyPort    int64         `protobuf:"varint,3,opt,name=proxy_port,json=proxyPort,proto3" json:"proxy_port,omitempty"`
	Anonymity    string        `protobuf:"bytes,5,opt,name=anonymity,proto3" json:"anonymity,omitempty"`
	ProxyCountry *ProxyCountry `protobuf:"bytes,4,opt,name=proxy_country,json=proxyCountry,proto3" json:"proxy_country,omitempty"`
	CreatedAt    *time.Time    `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at,omitempty"`
	UpdatedAt    *time.Time    `protobuf:"bytes,7,opt,name=updated_at,json=updatedAt,proto3,stdtime" json:"updated_at,omitempty"`
	DeletedAt    *time.Time    `protobuf:"bytes,8,opt,name=deleted_at,json=deletedAt,proto3,stdtime" json:"deleted_at,omitempty"`
}

func NewPopulatedProxyItem

func NewPopulatedProxyItem(r randyProxy, easy bool) *ProxyItem

func (*ProxyItem) Descriptor

func (*ProxyItem) Descriptor() ([]byte, []int)

func (*ProxyItem) Equal

func (this *ProxyItem) Equal(that interface{}) bool

func (*ProxyItem) GetAnonymity

func (m *ProxyItem) GetAnonymity() string

func (*ProxyItem) GetCreatedAt

func (m *ProxyItem) GetCreatedAt() *time.Time

func (*ProxyItem) GetDeletedAt

func (m *ProxyItem) GetDeletedAt() *time.Time

func (*ProxyItem) GetProxyCountry

func (m *ProxyItem) GetProxyCountry() *ProxyCountry

func (*ProxyItem) GetProxyId

func (m *ProxyItem) GetProxyId() int64

func (*ProxyItem) GetProxyIp

func (m *ProxyItem) GetProxyIp() string

func (*ProxyItem) GetProxyPort

func (m *ProxyItem) GetProxyPort() int64

func (*ProxyItem) GetUpdatedAt

func (m *ProxyItem) GetUpdatedAt() *time.Time

func (*ProxyItem) GoString

func (this *ProxyItem) GoString() string

func (*ProxyItem) Marshal

func (m *ProxyItem) Marshal() (dAtA []byte, err error)

func (*ProxyItem) MarshalTo

func (m *ProxyItem) MarshalTo(dAtA []byte) (int, error)

func (*ProxyItem) MarshalToSizedBuffer

func (m *ProxyItem) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ProxyItem) ProtoMessage

func (*ProxyItem) ProtoMessage()

func (*ProxyItem) Reset

func (m *ProxyItem) Reset()

func (*ProxyItem) Size

func (m *ProxyItem) Size() (n int)

func (*ProxyItem) String

func (this *ProxyItem) String() string

func (*ProxyItem) Unmarshal

func (m *ProxyItem) Unmarshal(dAtA []byte) error

func (*ProxyItem) XXX_DiscardUnknown

func (m *ProxyItem) XXX_DiscardUnknown()

func (*ProxyItem) XXX_Marshal

func (m *ProxyItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ProxyItem) XXX_Merge

func (m *ProxyItem) XXX_Merge(src proto.Message)

func (*ProxyItem) XXX_Size

func (m *ProxyItem) XXX_Size() int

func (*ProxyItem) XXX_Unmarshal

func (m *ProxyItem) XXX_Unmarshal(b []byte) error

type ProxyServer

ProxyServer is the server API for Proxy service.

type ProxyStat

type ProxyStat struct {
	//    Удалил бывший PK
	//    int64 stat_id = 1;
	ProxyId    int64 `protobuf:"varint,2,opt,name=proxy_id,json=proxyId,proto3" json:"proxy_id,omitempty"`
	ConnTime   int64 `protobuf:"varint,3,opt,name=conn_time,json=connTime,proto3" json:"conn_time,omitempty"`
	ConnStatus bool  `protobuf:"varint,4,opt,name=conn_status,json=connStatus,proto3" json:"conn_status,omitempty"`
	//    Новый PK
	CreatedAt *time.Time `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at,omitempty"`
}

func NewPopulatedProxyStat

func NewPopulatedProxyStat(r randyProxy, easy bool) *ProxyStat

func (*ProxyStat) Descriptor

func (*ProxyStat) Descriptor() ([]byte, []int)

func (*ProxyStat) Equal

func (this *ProxyStat) Equal(that interface{}) bool

func (*ProxyStat) GetConnStatus

func (m *ProxyStat) GetConnStatus() bool

func (*ProxyStat) GetConnTime

func (m *ProxyStat) GetConnTime() int64

func (*ProxyStat) GetCreatedAt

func (m *ProxyStat) GetCreatedAt() *time.Time

func (*ProxyStat) GetProxyId

func (m *ProxyStat) GetProxyId() int64

func (*ProxyStat) GoString

func (this *ProxyStat) GoString() string

func (*ProxyStat) Marshal

func (m *ProxyStat) Marshal() (dAtA []byte, err error)

func (*ProxyStat) MarshalTo

func (m *ProxyStat) MarshalTo(dAtA []byte) (int, error)

func (*ProxyStat) MarshalToSizedBuffer

func (m *ProxyStat) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ProxyStat) ProtoMessage

func (*ProxyStat) ProtoMessage()

func (*ProxyStat) Reset

func (m *ProxyStat) Reset()

func (*ProxyStat) Size

func (m *ProxyStat) Size() (n int)

func (*ProxyStat) String

func (this *ProxyStat) String() string

func (*ProxyStat) Unmarshal

func (m *ProxyStat) Unmarshal(dAtA []byte) error

func (*ProxyStat) XXX_DiscardUnknown

func (m *ProxyStat) XXX_DiscardUnknown()

func (*ProxyStat) XXX_Marshal

func (m *ProxyStat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ProxyStat) XXX_Merge

func (m *ProxyStat) XXX_Merge(src proto.Message)

func (*ProxyStat) XXX_Size

func (m *ProxyStat) XXX_Size() int

func (*ProxyStat) XXX_Unmarshal

func (m *ProxyStat) XXX_Unmarshal(b []byte) error

type Server

type Server struct {
	UnimplementedProxyServer
	// contains filtered or unexported fields
}

func NewServer

func NewServer(cfg *config.Config, log *zap.SugaredLogger, db *pgxpool.Pool) *Server

func (*Server) CreateProxy

func (s *Server) CreateProxy(ctx context.Context, req *CreateProxyRequest) (*CreateProxyResponse, error)

func (*Server) CreateProxyStat

func (s *Server) CreateProxyStat(ctx context.Context, req *CreateProxyStatRequest) (*CreateProxyStatResponse, error)

func (*Server) GetNextProxy

func (s *Server) GetNextProxy(ctx context.Context, req *GetNextProxyRequest) (*GetNextProxyResponse, error)

GetNextProxy возвращает прокси которое нужно проверить. Возвращаются те которые еще не проверялись, либо отсортированные по времени проверки.

func (*Server) GracefulStop

func (s *Server) GracefulStop()

func (*Server) Serve

func (s *Server) Serve() error

type Store

type Store struct {
	// contains filtered or unexported fields
}

func New

func New(log *zap.SugaredLogger, db *pgxpool.Pool) *Store

func (*Store) CreateProxyStat

func (s *Store) CreateProxyStat(ctx context.Context, stat *ProxyStat) error

func (*Store) GetNextProxyItem

func (s *Store) GetNextProxyItem(ctx context.Context) (*ProxyItem, error)

func (*Store) GetNextProxyItemBatch

func (s *Store) GetNextProxyItemBatch(ctx context.Context, size int) error

func (*Store) GetOrCreateProxyCountry

func (s *Store) GetOrCreateProxyCountry(c *ProxyCountry) error

func (*Store) GetOrCreateProxyItem

func (s *Store) GetOrCreateProxyItem(ctx context.Context, p *ProxyItem) error

func (*Store) InsertProxyCountry

func (s *Store) InsertProxyCountry(c *ProxyCountry) error

func (*Store) InsertProxyItem

func (s *Store) InsertProxyItem(p *ProxyItem) error

func (*Store) NextProxyItemProducer

func (s *Store) NextProxyItemProducer(ctx context.Context) (ProxyItem, error)

NextProxyItemProducer вынимает ProxyItem из nextProxyQueue Если элемента нет, вызывает функцию пополнения, и повторяет попытку взять элемент

func (*Store) SelectProxyCountryIdByCode

func (s *Store) SelectProxyCountryIdByCode(c *ProxyCountry) error

func (*Store) SelectProxyIdByUI

func (s *Store) SelectProxyIdByUI(p *ProxyItem) error

type UnimplementedProxyServer

type UnimplementedProxyServer struct {
}

UnimplementedProxyServer can be embedded to have forward compatible implementations.

func (*UnimplementedProxyServer) CreateProxy

func (*UnimplementedProxyServer) CreateProxyStat

func (*UnimplementedProxyServer) GetBestProxy

func (*UnimplementedProxyServer) GetNextProxy

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL