cvbot

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

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

Go to latest
Published: Apr 14, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

README

CV Bot

A demo repo for the talk in 20190628 Chatbot Meetup 10

Requirement

You need to set up a LINE Bot API endpoint via https://developers.line.biz/console/

Run

cd deploy; docker-compose up -d
Cloud Run
deploy/deploy.sh

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CVApp

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

CVApp app

func (*CVApp) HandleEvent

func (app *CVApp) HandleEvent(ctx context.Context, event *linebot.Event) (replyMsgs []linebot.SendingMessage, err error)

HandleEvent implements event handler with provider-based logic

func (*CVApp) ParseRequest

func (app *CVApp) ParseRequest(ctx context.Context, r *http.Request) (interface{}, error)

ParseRequest parse http.Request into events

func (*CVApp) Webhook

func (app *CVApp) Webhook(ctx context.Context, r interface{}) (int, error)

Webhook handles parsed events

type Logger

type Logger interface {
	Printf(format string, args ...interface{})
	Fatalf(format string, args ...interface{})
}

type Middleware

type Middleware func(Service) Service

Middleware describes a service (as opposed to endpoint) middleware.

func LoggingMiddleware

func LoggingMiddleware(logger Logger) Middleware

LoggingMiddleware returns a service middleware that logs the parameters and result of each method invocation.

func TraceMiddleware

func TraceMiddleware() Middleware

TraceMiddleware returns a service middleware that logs the parameters and result of each method invocation.

type Service

type Service interface {
	Webhook(context.Context, interface{}) (int, error)
	ParseRequest(context.Context, *http.Request) (interface{}, error)
}

Service describes a service that adds things together.

func NewCVApp

func NewCVApp() Service

NewCVApp returns a naïve, stateless implementation of Service.

Directories

Path Synopsis
cmd
cv
aws
gcp

Jump to

Keyboard shortcuts

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