Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/rsjethani/secret
/ functions
Functions
12 in github.com/rsjethani/secret
⨍
Functions
12
◇
Types & classes
1
↓ 5 callers
Method
Secret
Secret returns the actual secret string stored inside [Text].
secret.go:55
↓ 2 callers
Function
New
New returns [Text] for the secret with [FiveStar] as the default redact string. Provide options like [RedactAs] to modify default behavior.
secret.go:14
↓ 1 callers
Function
RedactAs
RedactAs is a functional option to set r as the redact string for [Text]. You can use one of the common redact strings provided with this package like
secret.go:32
↓ 1 callers
Method
String
String implements the [fmt.Stringer] interface and returns only the redact string. This prevents the actual secret string from being sent to std*, log
secret.go:47
Function
Equal
Equal returns true if both arguments have the same secret regardless of the redact strings.
secret.go:83
Function
ExampleEqual
()
example_test.go:71
Function
ExampleNew
()
example_test.go:10
Function
ExampleRedactAs
()
example_test.go:17
Function
ExampleText_MarshalText
()
example_test.go:33
Function
ExampleText_UnmarshalText
()
example_test.go:52
Method
MarshalText
MarshalText implements [encoding.TextMarshaler]. It marshals redact string into bytes rather than the actual secret value.
secret.go:64
Method
UnmarshalText
UnmarshalText implements [encoding.TextUnmarshaler]. It unmarshals b into receiver's new secret value. If redact string is present then it is reused.
secret.go:70