git.frostfs.info/TrueCloudLab/frostfs-sdk-go@v0.0.0-20241022124111-5361f0ecebd3/container/doc.go (about)

     1  /*
     2  Package container provides functionality related to the FrostFS containers.
     3  
     4  The base type is Container. To create new container in the FrostFS network
     5  Container instance should be initialized
     6  
     7  	var cnr Container
     8  	cnr.Init()
     9  	// fill all the fields
    10  
    11  	// encode cnr and send
    12  
    13  After the container is persisted in the FrostFS network, applications can process
    14  it using the instance of Container types
    15  
    16  	// recv binary container
    17  
    18  	var cnr Container
    19  
    20  	err := cnr.Unmarshal(bin)
    21  	// ...
    22  
    23  	// process the container data
    24  
    25  Instances can be also used to process FrostFS API V2 protocol messages
    26  (see neo.fs.v2.container package in https://git.frostfs.info/TrueCloudLab/frostfs-api).
    27  
    28  On client side:
    29  
    30  	import "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container"
    31  
    32  	var msg container.Container
    33  	cnr.WriteToV2(&msg)
    34  
    35  	// send msg
    36  
    37  On server side:
    38  
    39  	// recv msg
    40  
    41  	var cnr Container
    42  	cnr.ReadFromV2(msg)
    43  
    44  	// process cnr
    45  
    46  Using package types in an application is recommended to potentially work with
    47  different protocol versions with which these types are compatible.
    48  */
    49  package container