infra

package
v0.0.0-...-b4fdffc Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorServiceNotFound          = errors.New("service not found")
	ErrorServiceAlreadyExist      = errors.New("service already exist")
	ErrorServiceEventNotFound     = errors.New("service event not found")
	ErrorServiceEventAlreadyExist = errors.New("service event already exist")
	ErrorClientNotFound           = errors.New("client not found")
	ErrorClientAlreadyExist       = errors.New("client already exist")
	ErrorSubscriptinEventNotFound = errors.New("not subscription event in table")
)

Functions

func NewLogManager

func NewLogManager() *producer.LoggerManager

Types

type Battery

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

func NewBattery

func NewBattery() *Battery

func (*Battery) Get

func (b *Battery) Get(key string) (interface{}, error)

func (*Battery) Init

func (b *Battery) Init(interval time.Duration, updater func() []batterygo.BatteryArgument) error

func (*Battery) Set

func (b *Battery) Set(key string, value interface{}) error

type DynamodbClient

type DynamodbClient struct {
	INDEX_AUXILIAR_ASSOCIATION string
	// contains filtered or unexported fields
}

DynamodbClient is struct for client dynamodb

func NewDynamodbClient

func NewDynamodbClient() *DynamodbClient

NewDynamodbClient return new client dynamodb

func (*DynamodbClient) CreateClients

func (d *DynamodbClient) CreateClients(client dto.ClientDTO) (string, error)

CreateClients execute creation the clients in dynamo table

func (*DynamodbClient) CreateScope

func (d *DynamodbClient) CreateScope(scope dto.ScopeDTO) error

CreateScope execute creation the scopes in dynamo table

func (*DynamodbClient) CreateServices

func (d *DynamodbClient) CreateServices(serv dto.ServicesDTO) (string, error)

CreateServices execute creation the services in dynamo table

func (*DynamodbClient) CreateSubscription

func (d *DynamodbClient) CreateSubscription(subs *dto.SubscriptionDTO) (dto.SubscriptionDTO, error)

CreateSubscription execute creation the subscription in dynamo table

func (*DynamodbClient) DeleteClients

func (d *DynamodbClient) DeleteClients(apiKey, service string) error

DeleteClients remove client in table

func (*DynamodbClient) DeleteServices

func (d *DynamodbClient) DeleteServices(serviceName, event string) error

DeleteServices execute remotion of events the services

func (*DynamodbClient) DeleteSubscription

func (d *DynamodbClient) DeleteSubscription(clientId, event, url string) error

DeleteSubscription execute remove the event subscription

func (*DynamodbClient) DescribeTable

func (d *DynamodbClient) DescribeTable() (interface{}, error)

DescribeTable return informations from table

func (*DynamodbClient) ExistClient

func (d *DynamodbClient) ExistClient(association_id, service string) (entity.Clients, bool, error)

ExisteClient return client by identifier in table

func (*DynamodbClient) ExistService

func (d *DynamodbClient) ExistService(serviceName string) (bool, string, error)

ExistService return boolean if exist service in table

func (*DynamodbClient) GetClientByApiKey

func (d *DynamodbClient) GetClientByApiKey(apiKey string) (entity.Clients, error)

GetClientByApiKey return client by api key

func (*DynamodbClient) GetClients

func (d *DynamodbClient) GetClients(apiKey, service string) (entity.Clients, error)

GetClients return client with service by apiKey hash

func (*DynamodbClient) GetClientsByClientId

func (d *DynamodbClient) GetClientsByClientId(clientId string) (entity.Clients, error)

GetClientsByClientId return client with service by clientId

func (*DynamodbClient) GetServiceByApiKey

func (d *DynamodbClient) GetServiceByApiKey(apiKey string) (entity.Services, error)

GetClientByApiKey return service by api key

func (*DynamodbClient) GetServices

func (d *DynamodbClient) GetServices(serviceName string) ([]entity.Services, error)

GetServices return all events from service

func (*DynamodbClient) GetServicesEvents

func (d *DynamodbClient) GetServicesEvents(serviceName, event string) (entity.Services, error)

GetServicesEvents return service event from table

func (*DynamodbClient) GetSubscription

func (d *DynamodbClient) GetSubscription(associationId, event string) (entity.Subscription, error)

GetSubscription return subscription from event and associationId

func (*DynamodbClient) GetSubscriptionByAssociationIdAndEvent

func (d *DynamodbClient) GetSubscriptionByAssociationIdAndEvent(associationId, event string) ([]entity.Subscription, error)

GetSubscription return subscription from part of a event and associationId

func (*DynamodbClient) ListClients

func (d *DynamodbClient) ListClients() ([]entity.Clients, error)

ListClients return all clients the table

func (*DynamodbClient) ListServices

func (d *DynamodbClient) ListServices() ([]entity.Services, error)

ListServices return all services with events

func (*DynamodbClient) ListSubscriptions

func (d *DynamodbClient) ListSubscriptions(associationId string) ([]dto.SubscriptionDTO, error)

ListSubscriptions return all subscriptions the client

func (*DynamodbClient) PutEventService

func (d *DynamodbClient) PutEventService(serviceName, idService, event string) (interface{}, error)

PutEventService add event to service

func (*DynamodbClient) Setup

func (d *DynamodbClient) Setup() error

Setup execute configuration the session of client dynamodb

type RabbitMQ

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

RabbitMQ is struct for broker in amazon mq

func NewRabbitMQ

func NewRabbitMQ() *RabbitMQ

NewRabbitMQ return new instance of RabbitMQ

func (*RabbitMQ) Ack

func (r *RabbitMQ) Ack(deliveredTag uint64) error

func (*RabbitMQ) ChannelCallbackIsClosed

func (r *RabbitMQ) ChannelCallbackIsClosed() bool

func (*RabbitMQ) ChannelNotifyIsClosed

func (r *RabbitMQ) ChannelNotifyIsClosed() bool

func (*RabbitMQ) ChannelPubSubIsClosed

func (r *RabbitMQ) ChannelPubSubIsClosed() bool

func (*RabbitMQ) ConnectionIsClosed

func (r *RabbitMQ) ConnectionIsClosed() bool

func (*RabbitMQ) Consumer

func (r *RabbitMQ) Consumer() (<-chan amqp.Delivery, error)

Consumer is return channel for consume from broker

func (*RabbitMQ) ConsumerDlq

func (r *RabbitMQ) ConsumerDlq() (<-chan amqp.Delivery, error)

ConsumerDlq is return channel for consume dlq from broker

func (*RabbitMQ) ConsumerNotifyQueue

func (r *RabbitMQ) ConsumerNotifyQueue() (<-chan amqp.Delivery, error)

func (*RabbitMQ) Dlq

func (r *RabbitMQ) Dlq(queueMessage dto.QueueMessage) error

Dlq is send message to dlq broker

func (*RabbitMQ) NumberOfMessagesQueue

func (r *RabbitMQ) NumberOfMessagesQueue() error

func (*RabbitMQ) Producer

func (r *RabbitMQ) Producer(queueMessage dto.NotifierDTO) error

Producer is send message to broker

func (*RabbitMQ) ProducerCashinCallback

func (r *RabbitMQ) ProducerCashinCallback(callbackCashinMessage dto.CallbackCashinMessage) error

ProducerCashinCallback is send message to callback queue

func (*RabbitMQ) ProducerCashoutCallback

func (r *RabbitMQ) ProducerCashoutCallback(callbackCashoutMessage dto.CallbackCashoutMessage) error

ProducerCashoutCallback is send message to callback queue

func (*RabbitMQ) ProducerNotify

func (r *RabbitMQ) ProducerNotify(notify dto.NotifierDTO) error

ProducerNotify is send message to notify queue

func (*RabbitMQ) Release

func (r *RabbitMQ) Release()

Release is close connection

func (*RabbitMQ) Setup

func (r *RabbitMQ) Setup() error

Setup is configure broker

type SecretManagerClient

type SecretManagerClient struct {
	Environments map[string]interface{}
}

SecretManagerClient is

func NewSecretManagerClient

func NewSecretManagerClient() *SecretManagerClient

func (*SecretManagerClient) Get

func (s *SecretManagerClient) Get(envVar string) interface{}

Get return value of variable

func (*SecretManagerClient) GetValueBetweenString

func (s *SecretManagerClient) GetValueBetweenString(haystack, start, end string) string

getValueBetweenString return value into string env

func (*SecretManagerClient) RetrieveSecret

func (s *SecretManagerClient) RetrieveSecret(secretName string) string

retrieveSecret configure secret manager

type SqsClient

type SqsClient struct {
	Client *sqs.SQS
	// contains filtered or unexported fields
}

SqsClient is struct of client sqs

func NewSqsClient

func NewSqsClient() *SqsClient

NewSqsClient return new client the sqs

func (*SqsClient) Send

func (s *SqsClient) Send(subs dto.SubscriptionDTO, notification dto.NotifierDTO) (interface{}, error)

Send is function for execute send message to queue

func (*SqsClient) Setup

func (s *SqsClient) Setup() error

Setup execute configuration for session the sqs

Jump to

Keyboard shortcuts

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