services

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authentication added in v0.0.2

func Authentication(next http.Handler) http.Handler

func ProvideContext

func ProvideContext(r *http.Request) context.Context

func ProvideForwardedHeader added in v0.2.0

func ProvideForwardedHeader(req *http.Request) *url.URL

Types

type Address added in v0.3.3

type Address struct {
	Street  string `json:"street"`
	City    string `json:"city"`
	State   string `json:"state"`
	ZipCode string `json:"zipCode"`
}

type ContactRequest added in v0.3.3

type ContactRequest struct {
	ID string `json:"id"`
	Name
	EMail   string   `json:"eMail" format:"email"`
	Address *Address `json:"address"`
}

ContactRequest model

type ContactResponse added in v0.3.3

type ContactResponse struct {
	// id is the unique id of contact
	ID string `json:"id"`
}

ContactResponse model

type ContactsService

type ContactsService struct {
	DataConnector *connectors.DataConnector
}

func InitContactsService added in v0.0.2

func InitContactsService() (*ContactsService, error)

InitContactsService wires up the Contacts Service.

func NewContactsService added in v0.0.7

func NewContactsService(dc *connectors.DataConnector) ContactsService

func (ContactsService) Create

func (cs ContactsService) Create(ctx context.Context, contactRequest *ContactRequest) (*ContactResponse, error)

Create a new contact request entity.

func (ContactsService) DeleteBulk added in v0.1.5

func (cs ContactsService) DeleteBulk(ctx context.Context, ids []string) error

DeleteBulk contact by id

func (ContactsService) GetBunch added in v0.4.2

func (cs ContactsService) GetBunch(ctx context.Context, ids []int64) (*ContactResponse, error)

GetBunch of contacts by ids

@summary Get a list of contacts by ids @description Get a list of contacts by ids @tags contacts @produces application/json @parameters {"name":"ids", "description":"list of contact ids", "required":true} @responses.400 {models.ErrorResponse}

func (ContactsService) GetByDate added in v0.0.2

func (cs ContactsService) GetByDate(ctx context.Context, month, day, year string) (*ContactResponse, error)

Get contacts list by date

func (ContactsService) GetOne

func (cs ContactsService) GetOne(ctx context.Context, id int) (*ContactResponse, error)

GetOne contact by id id contact id

func (ContactsService) Redirect added in v0.4.4

func (cs ContactsService) Redirect(ctx context.Context, id string) (string, error)

Redirect sends a redirect in response

func (*ContactsService) Replace added in v0.0.2

func (cs *ContactsService) Replace(ctx context.Context, id int, contactRequest ContactRequest) (*ContactResponse, error)

Replace a contact entity completely.

func (ContactsService) Update

func (cs ContactsService) Update(ctx context.Context, id int, contactRequest ContactRequest) (*ContactResponse, error)

Update a contact entity with provided data.

type DoodadsService added in v0.1.6

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

func NewDoodadsService added in v0.1.6

func NewDoodadsService(env *connectors.Env) (*DoodadsService, error)

func (DoodadsService) Create added in v0.1.6

func (cs DoodadsService) Create(ctx context.Context, url *url.URL, wr *http.Request, thing *models.ThingRequest) (*models.ThingResponse, error)

Create a new doodad entity.

type Name added in v0.3.3

type Name struct {
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
}

type PingRequest added in v0.0.7

type PingRequest struct {
	Input string `json:"input"`
}

PingRequest model

type PingResponse added in v0.0.7

type PingResponse struct {
	Output string `json:"output"`
}

PingResponse model

func Ping added in v0.0.7

func Ping(ctx context.Context, env *connectors.Env, pingRequest PingRequest) (PingResponse, error)

Ping returns body with 'i's replaced with 'o's

Jump to

Keyboard shortcuts

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