user

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authorization

type Authorization struct {
	UserID             string              `json:"user_id"` // organization/tenant id
	Name               string              `json:"name"`    // organization/tenant name
	UserGroupID        map[string]struct{} `json:"user_group_id"`
	UiAndApiPermission map[string]bool     `json:"api_and_ui_permission"`
}

type Details

type Details struct {
	ID              string                   `json:"id"` // email
	Profile         UserProfile              `json:"profile"`
	GSI             GSIConfig                `json:"gsi"`
	MIP             MIPConfig                `json:"mip"`
	DefaultHomepage string                   `json:"default_homepage"`
	Authorization   map[string]Authorization `json:"authorization"` // organization/tenant id as key
}

type GSIConfig

type GSIConfig struct {
	Email string `json:"email"`
}

type MIPConfig

type MIPConfig struct {
	Email string `json:"email"`
}

type Payload

type Payload struct {
	Ns              string                   `json:"namespace"`
	Url             string                   `json:"url"`
	Id              string                   `json:"id"` // email
	Profile         UserProfile              `json:"profile"`
	GSI             GSIConfig                `json:"gsi"`
	MIP             MIPConfig                `json:"mip"`
	DefaultHomepage string                   `json:"default_homepage"`
	Authorization   map[string]Authorization `json:"authorization"` // organization/tenant id as key
	CreatedAt       string                   `json:"created_at"`
}

func (*Payload) CreatedTime

func (c *Payload) CreatedTime() time.Time

func (*Payload) ID

func (c *Payload) ID() string

func (*Payload) Namespace

func (c *Payload) Namespace() string

func (*Payload) RefIDs

func (c *Payload) RefIDs() []string

func (*Payload) URL

func (c *Payload) URL() string

func (*Payload) Validate

func (c *Payload) Validate() *types.CommonError

func (*Payload) WithCreatedTime

func (c *Payload) WithCreatedTime(t time.Time) mycontent.Data

func (*Payload) WithID

func (c *Payload) WithID(id string) mycontent.Data

func (*Payload) WithNamespace

func (c *Payload) WithNamespace(id string) mycontent.Data

func (*Payload) WithURL

func (c *Payload) WithURL(url string) mycontent.Data

type UseCase

type UseCase interface {
	GetByOrgID(ctx context.Context, organizationID, nameContained string) ([]Details, error)
	GetDetail(ctx context.Context, email string) (Details, error)
	Insert(ctx context.Context, payload Payload) error
	Update(ctx context.Context, email string, payload Payload) error
	Delete(ctx context.Context, email string) error
}

type UserProfile

type UserProfile struct {
	ID               string `json:"id"`
	ImageURL         string `json:"image_url"`
	Name             string `json:"name"`
	DisplayName      string `json:"display_name"`
	Role             string `json:"role"`
	Description      string `json:"description"`
	Avatar1x1URL     string `json:"avatar_1x1_url"`
	Background3x1URL string `json:"background_3x1_url"`
	CreatedAt        string `json:"created_at"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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