clients

package
v0.0.0-...-5ec18d9 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GCPProjectID  GCP project ID in use
	GCPProjectID = "your-gcp-project-id"
	// DefaultLanguage of the bot
	DefaultLanguage = "en"
	// ENUSLanguage US English
	ENUSLanguage = "en-US"
	// DefaultTimeZone where user is in
	DefaultTimeZone = "PST"
	// DefaultTimeout for API timeout
	DefaultTimeout = 10 * time.Second
)

Variables

This section is empty.

Functions

func NewAgents

func NewAgents() *cx.AgentsClient

NewAgents returns a new AgentsClient

func NewFlows

func NewFlows() *cx.FlowsClient

NewFlows returns a new FlowsClient

func NewIntents

func NewIntents() *cx.IntentsClient

NewAgentsClient returns a new AgentsClient

func NewPages

func NewPages() *cx.PagesClient

NewPages returns a new PagesClient

func NewSessions

func NewSessions() *cx.SessionsClient

NewSessions returns a new SessionsClient

Types

type CX

type CX interface {
	GetIntents(ctx context.Context, opts *CXAgentOpts) ([]*cxpb.Intent, error)
	GetFlows(ctx context.Context, opts *CXAgentOpts) ([]*cxpb.Flow, error)
	GetPages(ctx context.Context, opts *CXAgentOpts) ([]*cxpb.Page, error)
	GetAgent(ctx context.Context, opts *CXAgentOpts) (*cxpb.Agent, error)
	Close()
}

CX is the interface for accessing the Dialogflow CX client. Generate the mock interface for this. mockgen -destination=mocks/clients/mock_cx.go -package=mocks -source=clients/get.go CX

func New

func New() CX

type CXAgentOpts

type CXAgentOpts struct {
	ProjectID   string
	AgentID     string
	Verbose     bool
	Lang        string
	Location    string
	OutFilename string
	InFilename  string
}

CXAgentOpts options passed to the agent.

type Environment

type Environment string

Environment is Dialogflow CX bot environments

const (
	Draft   Environment = "DRAFT" // DRAFT environment
	Staging Environment = "STAGING"
	Prod    Environment = "PROD"
)

Dialog flow environmental names

func (Environment) String

func (e Environment) String() string

String returns the string representation of the environment

Jump to

Keyboard shortcuts

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