Files
threshold/internal/refreshtoken/item.go
T
Johan Brandhorst-Satzkorn dcb67ca616 internal/refreshtoken: add refreshtoken package
The refreshtoken package encapsulates domain logic surrouding
the refresh token. A refresh token is used both for
paginating through a collection and for requesting any
updates to that collection.
2024-01-05 07:43:19 -08:00

35 lines
791 B
Go

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package refreshtoken
import (
"time"
"github.com/hashicorp/boundary/internal/db/timestamp"
"github.com/hashicorp/boundary/internal/types/resource"
)
// Item represents a generic resource with a public ID, update time
// and resource type.
type Item struct {
publicId string
updateTime time.Time
resourceType resource.Type
}
// GetPublicId gets the public ID of the item.
func (p *Item) GetPublicId() string {
return p.publicId
}
// GetUpdateTime gets the update time of the item.
func (p *Item) GetUpdateTime() *timestamp.Timestamp {
return timestamp.New(p.updateTime)
}
// GetResourceType gets the resource type of the item.
func (p *Item) GetResourceType() resource.Type {
return p.resourceType
}