util

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package util defines util functions for IAM platform.

Index

Constants

View Source
const (
	DefaultOffset = 0
	DefaultLimit  = 1000
)

Variables

This section is empty.

Functions

func GetInstanceID

func GetInstanceID(uid uint64, prefix string) string

GetInstanceID returns id format like: secret-2v69o5

func RandString added in v0.1.3

func RandString(length int) string

RandString returns a random string of a specified length.

Types

type OffsetLimit added in v0.1.5

type OffsetLimit struct {
	Offset int
	Limit  int
}

OffsetLimit is used to retrieve the records in the db by page.

func NewOffsetLimit added in v0.1.5

func NewOffsetLimit(offset *int, limit *int) *OffsetLimit

NewOffsetLimit uses offset/DefaultOffset and limit/DefaultLimit to generate an OffsetLimit.

Jump to

Keyboard shortcuts

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