Documentation ¶
Overview ¶
Copyright (c) 2016-2019 Uber Technologies, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2016-2019 Uber Technologies, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2016-2019 Uber Technologies, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2016-2019 Uber Technologies, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Factory ¶
Factory creates Metadata objects given suffix.
type LastAccessTime ¶
LastAccessTime tracks a file's last access time.
func NewLastAccessTime ¶
func NewLastAccessTime(t time.Time) *LastAccessTime
NewLastAccessTime creates a LastAccessTime from t.
func (*LastAccessTime) Deserialize ¶
func (t *LastAccessTime) Deserialize(b []byte) error
Deserialize loads b into t.
func (*LastAccessTime) GetSuffix ¶
func (t *LastAccessTime) GetSuffix() string
GetSuffix returns the metadata suffix.
func (*LastAccessTime) Serialize ¶
func (t *LastAccessTime) Serialize() ([]byte, error)
Serialize converts t to bytes.
type Metadata ¶
type Metadata interface { GetSuffix() string Movable() bool Serialize() ([]byte, error) Deserialize([]byte) error }
Metadata defines types of matadata file. All implementations of Metadata must register themselves.
type Persist ¶
type Persist struct {
Value bool
}
Persist marks whether a blob should be persisted.
func NewPersist ¶
NewPersist creates a new Persist, where true means the blob should be persisted, and false means the blob is safe to delete.
func (*Persist) Deserialize ¶
Deserialize loads b into m.
type TorrentMeta ¶
TorrentMeta wraps torrent metainfo storage as metadata.
func NewTorrentMeta ¶
func NewTorrentMeta(mi *core.MetaInfo) *TorrentMeta
NewTorrentMeta return a new TorrentMeta.
func (*TorrentMeta) Deserialize ¶
func (m *TorrentMeta) Deserialize(b []byte) error
Deserialize loads b into m.
func (*TorrentMeta) GetSuffix ¶
func (m *TorrentMeta) GetSuffix() string
GetSuffix returns a static suffix.
func (*TorrentMeta) Serialize ¶
func (m *TorrentMeta) Serialize() ([]byte, error)
Serialize converts m to bytes.