passwordtypeent

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

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

Go to latest
Published: May 4, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

README

passwordtype-ent

Ent field helper for github.com/ubgo/passwordtype.

Returns a TEXT column tagged Sensitive() so ent's debug output never prints the argon2id hash.

Install

go get github.com/ubgo/passwordtype-ent

Use

import (
    "entgo.io/ent"

    passwordtypeent "github.com/ubgo/passwordtype-ent"
)

type User struct{ ent.Schema }

func (User) Fields() []ent.Field {
    return []ent.Field{
        passwordtypeent.Field("password"),
    }
}

For finer control compose directly:

field.String("password").
    GoType(passwordtype.HashedPassword{}).
    Sensitive().
    Optional()

License

Apache-2.0 — see LICENSE.

Documentation

Overview

Package passwordtypeent provides an ent.Field constructor for github.com/ubgo/passwordtype.HashedPassword columns.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Field

func Field(name string) ent.Field

Field returns an ent.Field for a HashedPassword column.

  • Stored as TEXT (the argon2id PHC string is variable-length).
  • Sensitive() set so the value is masked in ent's debug/print output.

For Optional, Immutable, dialect-specific column type, etc., compose directly:

field.String("password").
    GoType(passwordtype.HashedPassword{}).
    Sensitive().
    Optional()

Types

This section is empty.

Jump to

Keyboard shortcuts

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