Documentation
¶
Index ¶
Constants ¶
View Source
const ( IpAddressAny ipAddressPolicy = "Any" IpAddressAllow ipAddressPolicy = "Allow" IpAddressDeny ipAddressPolicy = "Deny" TimeSlotAny timeSlotPolicy = "Any" TimeSlotCheck timeSlotPolicy = "Check" )
View Source
const ( ISO8601 = "20060102T150405Z" SignAlgoRSASHA256 = "RSA-SHA256" EncodingHex encoding = "Hex" EncodingBase64 encoding = "Base64" )
Variables ¶
View Source
var ( ErrCustomPolicyIllegalIPAddr = errors.New("custom policy error: illegal ip address") ErrCustomPolicyIllegalTimeSlot = errors.New("custom policy error: illegal time slot") )
View Source
var ( ErrMissingURLParameter = errors.New("some parameters are missing") ErrIllegalURLParameter = errors.New("illegal parameter found") ErrURLExpired = errors.New("url was expired") ErrBeforeStartDate = errors.New("before the start date") ErrPrivateKeyNotSet = errors.New("private key not set") ErrParameterKeyAlreadyExist = errors.New("parameter key already exist") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Prefix string Encoding encoding Location *time.Location CustomPolicy *CustomPolicy }
type CustomPolicy ¶
type CustomPolicy struct {
// contains filtered or unexported fields
}
func NewCustomPolicy ¶
func NewCustomPolicy() *CustomPolicy
func (*CustomPolicy) JSONMarshal ¶
func (cp *CustomPolicy) JSONMarshal() ([]byte, error)
func (*CustomPolicy) RegisterIpAddressPolicy ¶
func (cp *CustomPolicy) RegisterIpAddressPolicy(p ipAddressPolicy, value []string) error
func (*CustomPolicy) RegisterTimeSlotPolicy ¶
func (cp *CustomPolicy) RegisterTimeSlotPolicy(p timeSlotPolicy, start, end string) error
type CustomPolicyFunc ¶
type CustomPolicyFunc func(*CustomPolicy) error
func IPAddr ¶
func IPAddr(addr string) CustomPolicyFunc
func TimeSlot ¶
func TimeSlot(now time.Time) CustomPolicyFunc
type SigUrl ¶
type SigUrl struct {
// contains filtered or unexported fields
}
func (*SigUrl) SignedInfoFromUrl ¶
func (s *SigUrl) SignedInfoFromUrl(parsedUrl *url.URL) (*SignedInfo, error)
type SignedInfo ¶
type SignedInfo struct { //署名付きURLが使用可能になる日付と時刻 Date time.Time //署名付きURLの有効期間 //Dateに格納された値からの秒数で表されます。 Expires int //署名値 Signature string //署名対象メッセージ(正規化する) Message string //ポリシー CustomPolicy string }
func (*SignedInfo) SignatureBytes ¶
func (si *SignedInfo) SignatureBytes(e encoding) ([]byte, error)
Click to show internal directories.
Click to hide internal directories.