domain

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInputConflictOnSave = errors.New("conflic when saving an input: the input version is different from the persisted input")

Functions

This section is empty.

Types

type ChatDoesNotBelowToUserError

type ChatDoesNotBelowToUserError struct {
	UserID, ChatID int64
}

ChatDoesNotBelowToUserError is returned when the user isn't the owner of the chat.

func (ChatDoesNotBelowToUserError) Error

type ChatNotFoundError

type ChatNotFoundError struct {
	ChatID int64
}

ChatNotFoundError is returned when the passed chatID doesn't match with any chat.

func (ChatNotFoundError) Error

func (e ChatNotFoundError) Error() string

type Input

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

func (Input) Description

func (i Input) Description() string

func (Input) ID

func (i Input) ID() int64

func (Input) InputType

func (i Input) InputType() InputType

func (Input) Name

func (i Input) Name() string

func (Input) OwnerID

func (i Input) OwnerID() int64

func (Input) Version

func (i Input) Version() int64

type InputFactory

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

func NewInputFactory

func NewInputFactory(telegramClient TelegramService) InputFactory

func (InputFactory) Build

func (f InputFactory) Build(ctx context.Context, id int64, ownerID int64, inputType InputType, name string, description string) (Input, error)

type InputRepository

type InputRepository interface {
	Save(ctx context.Context, input Input) error
}

type InputType

type InputType struct {
	// contains filtered or unexported fields
}
var (
	TelegramPrivate    InputType = InputType{/* contains filtered or unexported fields */}
	TelegramChannel    InputType = InputType{/* contains filtered or unexported fields */}
	TelegramGroup      InputType = InputType{/* contains filtered or unexported fields */}
	TelegramSuperGroup InputType = InputType{/* contains filtered or unexported fields */}
)

func NewInputTypeFromStr

func NewInputTypeFromStr(value string) InputType

func (InputType) Value

func (i InputType) Value() string

type TelegramService

type TelegramService interface {
	// IsChatValid verify if chat below to the user ID and if the current bot
	// have the required permissions on that chat.
	IsChatValid(ctx context.Context, chatId, userId int64) (bool, error)
}

TelegramService represent a service to access to TelegramAPI

Jump to

Keyboard shortcuts

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