You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
387 B
23 lines
387 B
5 years ago
|
package stringbased
|
||
|
|
||
|
import (
|
||
|
"github.com/mainnika/mongox-go-driver/v2/mongox"
|
||
|
)
|
||
|
|
||
|
var _ mongox.StringBased = (*Primary)(nil)
|
||
|
|
||
|
// Primary is a structure with string as an _id field
|
||
|
type Primary struct {
|
||
|
ID string `bson:"_id" json:"_id"`
|
||
|
}
|
||
|
|
||
|
// GetID returns an _id
|
||
|
func (p *Primary) GetID() string {
|
||
|
return p.ID
|
||
|
}
|
||
|
|
||
|
// SetID sets an _id
|
||
|
func (p *Primary) SetID(id string) {
|
||
|
p.ID = id
|
||
|
}
|