Documentation ¶
Overview ¶
Copyright 2023 Meta Platforms, Inc. and affiliates.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Copyright 2023 Meta Platforms, Inc. and affiliates.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Copyright 2023 Meta Platforms, Inc. and affiliates.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Copyright 2023 Meta Platforms, Inc. and affiliates.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Copyright 2023 Meta Platforms, Inc. and affiliates.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Index ¶
- Constants
- type BootFlow
- type CachingPolicy
- type HashValue
- type ImageID
- func (imgID ImageID) BlobStorageKey() []byte
- func (imgID ImageID) GoString() string
- func (imgID ImageID) IsZero() bool
- func (imgID ImageID) MarshalJSON() ([]byte, error)
- func (imgID *ImageID) Scan(srcI any) error
- func (imgID *ImageID) Set(in string) error
- func (imgID ImageID) String() string
- func (imgID *ImageID) UnmarshalJSON(b []byte) error
- func (imgID ImageID) Value() (driver.Value, error)
- type JobID
Constants ¶
const ( // CachingPolicyDefault means that the receiving side may chose the policy. CachingPolicyDefault = CachingPolicy(iota) // CachingPolicyDisable disables cache. CachingPolicyDisable // CachingPolicyUse enforces only to re-use existing cache, but to do not update it. CachingPolicyUse // CachingPolicyStore enforces only to update cache, but do not use it. CachingPolicyStore // CachingPolicyUseAndStore enables cache. CachingPolicyUseAndStore )
const ( // HashAlgSHA2_512 requests to use SHA2-512 function HashAlgSHA2_512 // HashAlgBlake3_512 requests to use Blake3-512 function HashAlgBlake3_512 )
noinspection GoSnakeCaseUsage
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BootFlow ¶
BootFlow is a wrapper for types.Flow to make it serializable/deserializable using xjson.
func (BootFlow) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*BootFlow) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type CachingPolicy ¶
type CachingPolicy int
CachingPolicy defines if a cache should be used
TODO: move this value into the context
func CachingPolicyFromThrift ¶
func CachingPolicyFromThrift(in caching_policy.CachingPolicy) CachingPolicy
CachingPolicyFromThrift convert Thrifty CachingPolicy to the internal one.
func (CachingPolicy) ShouldStore ¶
func (policy CachingPolicy) ShouldStore() bool
ShouldStore returns if a cache should be updated.
func (CachingPolicy) ShouldUse ¶
func (policy CachingPolicy) ShouldUse() bool
ShouldUse returns if a cache should be used.
func (CachingPolicy) String ¶
func (policy CachingPolicy) String() string
String implements fmt.Stringer.
type HashValue ¶
type HashValue []byte
HashValue represents a hashed value in the binary form.
func NewImageStableHash ¶
NewImageStableHash constructs an ImageStableHash for an image.
func NewImageStableHashFromImage ¶
NewImageStableHashFromImage constructs an ImageStableHash for an image.
TODO: Parallelize calculation.
type ImageID ¶
ImageID is an unique content-based ID of an image. See also: https://en.wikipedia.org/wiki/Content-addressable_storage
If you change this type, then you can modify and use fbcode/scripts/xaionaro/migrate_fas_0/main.go to perform the migration.
func NewImageIDFromBytes ¶
NewImageIDFromBytes just converts type []byte to ImageID.
func NewImageIDFromImage ¶
NewImageIDFromImage calculates an ImageID based on image content.
func (ImageID) BlobStorageKey ¶
BlobStorageKey returns the path should be used to store this image.
func (ImageID) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*ImageID) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type JobID ¶
JobID is an unique identifier of a job submitted to the server.
func NewJobIDFromBytes ¶
NewJobIDFromBytes contructs a JobID given its binary representation.
func ParseJobID ¶
ParseJobID parses an UUID string as JobID.