Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ResourceID ¶
type ResourceID string
const ( // UserID 定义用户资源标识符. UserID ResourceID = "user" // PostID 定义博文资源标识符. PostID ResourceID = "post" )
func (ResourceID) String ¶
func (rid ResourceID) String() string
String 将资源标识符转换为字符串.
Example ¶
package main import ( "fmt" "github.com/onexstack/miniblog/internal/pkg/rid" ) func main() { // 定义一个资源标识符,例如用户资源 userID := rid.UserID // 调用String方法,将ResourceID类型转换为字符串类型 idString := userID.String() // 输出结果 fmt.Println(idString) }
Output: user
Click to show internal directories.
Click to hide internal directories.