2021-05-25 19:59:21 +00:00
|
|
|
package accessbox
|
|
|
|
|
|
|
|
import "github.com/nspcc-dev/neofs-api-go/pkg/token"
|
|
|
|
|
|
|
|
type (
|
2021-05-26 18:23:36 +00:00
|
|
|
// Box provides marshalling/unmarshalling for the token.
|
2021-05-25 19:59:21 +00:00
|
|
|
Box interface {
|
|
|
|
Marshal() ([]byte, error)
|
|
|
|
Unmarshal([]byte) error
|
|
|
|
}
|
|
|
|
|
2021-05-26 18:23:36 +00:00
|
|
|
// Encoder provides encoding method.
|
2021-05-25 19:59:21 +00:00
|
|
|
Encoder interface {
|
|
|
|
Encode(Box) error
|
|
|
|
}
|
|
|
|
|
2021-05-26 18:23:36 +00:00
|
|
|
// Decoder provides decoding method.
|
2021-05-25 19:59:21 +00:00
|
|
|
Decoder interface {
|
|
|
|
Decode(Box) error
|
|
|
|
}
|
|
|
|
|
2021-05-26 18:23:36 +00:00
|
|
|
// BearerTokenBox is a marshalling/unmarshalling bearer token wrapper.
|
2021-05-25 19:59:21 +00:00
|
|
|
BearerTokenBox interface {
|
|
|
|
Box
|
|
|
|
|
|
|
|
Token() *token.BearerToken
|
|
|
|
SetToken(*token.BearerToken)
|
|
|
|
}
|
|
|
|
)
|