slug

package
v2.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name = "Slug"
)

Variables

This section is empty.

Functions

func ToContext

func ToContext(ctx context.Context, v *Service) context.Context

Types

type Configs

type Configs struct {
	SlugAlphabet string `env:"SLUG_ALPHABET" envDefault:"abcdefghijklmnopqrstuvwxyz0123456789"`
	SlugLength   int    `env:"SLUG_LENGTH" envDefault:"8"`
}

type Service

type Service struct {
	Configs
}

func FromContext

func FromContext(ctx context.Context) *Service

func NewService

func NewService(configs Configs) *Service

func (Service) Generate

func (s Service) Generate() string

Jump to

Keyboard shortcuts

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