gopher

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2023 License: MIT Imports: 10 Imported by: 0

README

gopher

A Go package to make it quicker for me to build on-off scripts to automate simple tasks.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Runners

func Runners(maxRunners uint, items []any, worker func(i int, x any))

Types

type Config

type Config struct {
	ZendeskSubdomain string `env:"GOPHER_ZENDESK_SUBDOMAIN"`
	ZendeskEmail     string `env:"GOPHER_ZENDESK_EMAIL"`
	ZendeskToken     string `env:"GOPHER_ZENDESK_TOKEN"`
	OpenAIKey        string `env:"GOPHER_OPENAI_KEY"`
	DatabaseUser     string `env:"GOPHER_DATABASE_USER"`
	DatabasePass     string `env:"GOPHER_DATABASE_PASS"`
	DatabaseHost     string `env:"GOPHER_DATABASE_HOST"`
	DatabasePort     uint   `env:"GOPHER_DATABASE_PORT"`
	DatabaseName     string `env:"GOPHER_DATABASE_NAME"`
}

type DBALConfig added in v0.0.3

type DBALConfig struct {
	User string
	Pass string
	Host string
	Port uint
	Name string
}

func (DBALConfig) DSN added in v0.0.3

func (config DBALConfig) DSN() string

type DatabaseAbstractionLayer added in v0.0.3

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

func NewDBAL added in v0.0.3

func NewDBAL(config DBALConfig) *DatabaseAbstractionLayer

func (*DatabaseAbstractionLayer) SelectAll added in v0.0.3

func (dbal *DatabaseAbstractionLayer) SelectAll(ctx context.Context, target any, query string, bind any) error

func (*DatabaseAbstractionLayer) SelectSingle added in v0.0.3

func (dbal *DatabaseAbstractionLayer) SelectSingle(ctx context.Context, target any, query string, bind any) error

func (*DatabaseAbstractionLayer) TruncateTables added in v0.0.3

func (dbal *DatabaseAbstractionLayer) TruncateTables(t *testing.T, tables []string)

type DatabaseEntity added in v0.0.3

type DatabaseEntity interface {
	TableName() string
}

type Service

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

func NewService

func NewService(config Config) *Service

func NewServiceWithConfig

func NewServiceWithConfig() *Service

func (*Service) AI

func (s *Service) AI() *openai.Client

func (*Service) AIPrompt

func (s *Service) AIPrompt(ctx context.Context, prompt string, args ...any) (string, error)

func (*Service) DBAL added in v0.0.3

func (s *Service) DBAL() *DatabaseAbstractionLayer

func (*Service) ZD

func (s *Service) ZD() *zendesk.Client

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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