client

package
v0.0.0-...-fa8f276 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package client is a generated GoMock package.

Package client is a generated GoMock package.

Index

Constants

View Source
const (
	UserAgent = "Mozilla/5.0 (compatible)"
)

Variables

View Source
var (
	NameRegex          = regexp.MustCompile(`[$\\]{?\d+`)
	ShindanNameRegex   = regexp.MustCompile(`[@@].+|[\((].+[\))]`)
	ShindanTokenRegex  = regexp.MustCompile(`<meta[^>]*name="csrf-token"[^>]*content="([\s\S]*?)"[^>]*>`)
	ShindanResultRegex = regexp.MustCompile(`<textarea[^>]*id="copy-textarea-140"[^>]*>([\s\S]*?)<\/textarea>`)
)

Functions

func NewHttpClient

func NewHttpClient() (*http.Client, error)

func NewMastodon

func NewMastodon(environment config.Environment) *mastodon.Client

Types

type Column

type Column struct {
	Name  string
	Value any
}

func NewColumn

func NewColumn(name string) *Column

func (*Column) String

func (c *Column) String() string

type DB

type DB interface {
	Query(ctx context.Context, q string) ([]string, error)
	UpdateCount(ctx context.Context, userID int64, date time.Time, count int) error
	Close() error
}

func NewDB

func NewDB(environment config.Environment) (DB, error)

type MockMpyw

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

MockMpyw is a mock of Mpyw interface.

func NewMockMpyw

func NewMockMpyw(ctrl *gomock.Controller) *MockMpyw

NewMockMpyw creates a new mock instance.

func (*MockMpyw) Do

func (m *MockMpyw) Do(ctx context.Context, targetURL string, count int) (io.ReadCloser, error)

Do mocks base method.

func (*MockMpyw) EXPECT

func (m *MockMpyw) EXPECT() *MockMpywMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

type MockMpywMockRecorder

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

MockMpywMockRecorder is the mock recorder for MockMpyw.

func (*MockMpywMockRecorder) Do

func (mr *MockMpywMockRecorder) Do(ctx, targetURL, count any) *gomock.Call

Do indicates an expected call of Do.

type MockShindanmaker

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

MockShindanmaker is a mock of Shindanmaker interface.

func NewMockShindanmaker

func NewMockShindanmaker(ctrl *gomock.Controller) *MockShindanmaker

NewMockShindanmaker creates a new mock instance.

func (*MockShindanmaker) Do

func (m *MockShindanmaker) Do(ctx context.Context, name, targerURL string) (string, error)

Do mocks base method.

func (*MockShindanmaker) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockShindanmaker) Name

func (m *MockShindanmaker) Name(account service.Account) string

Name mocks base method.

type MockShindanmakerMockRecorder

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

MockShindanmakerMockRecorder is the mock recorder for MockShindanmaker.

func (*MockShindanmakerMockRecorder) Do

func (mr *MockShindanmakerMockRecorder) Do(ctx, name, targerURL any) *gomock.Call

Do indicates an expected call of Do.

func (*MockShindanmakerMockRecorder) Name

func (mr *MockShindanmakerMockRecorder) Name(account any) *gomock.Call

Name indicates an expected call of Name.

type Mpyw

type Mpyw interface {
	Do(ctx context.Context, targetURL string, count int) (io.ReadCloser, error)
}

func NewMpyw

func NewMpyw(client *http.Client) Mpyw

type Shindanmaker

type Shindanmaker interface {
	Do(ctx context.Context, name string, targerURL string) (string, error)
	Name(account service.Account) string
}

func NewShindanmaker

func NewShindanmaker(client *http.Client) Shindanmaker

Jump to

Keyboard shortcuts

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