github.com/alibaba/ilogtail/pkg@v0.0.0-20250526110833-c53b480d046c/models/bytes.go (about)

     1  // Copyright 2022 iLogtail Authors
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //      http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package models
    16  
    17  // Defines a ByteArray event.
    18  // For example, the agent is deployed as a proxy
    19  // to directly transparently transmit the received binary data to the backend,
    20  // using ByteArray can avoid additional Marshal/Unmarshal overhead.
    21  type ByteArray []byte
    22  
    23  func (ByteArray) GetName() string {
    24  	return ""
    25  }
    26  
    27  func (ByteArray) SetName(name string) {
    28  }
    29  
    30  func (ByteArray) GetTags() Tags {
    31  	return NilStringValues
    32  }
    33  
    34  func (ByteArray) GetType() EventType {
    35  	return EventTypeByteArray
    36  }
    37  
    38  func (ByteArray) GetTimestamp() uint64 {
    39  	return 0
    40  }
    41  
    42  func (ByteArray) GetObservedTimestamp() uint64 {
    43  	return 0
    44  }
    45  
    46  func (ByteArray) SetObservedTimestamp(timestamp uint64) {
    47  }
    48  
    49  func (b ByteArray) GetSize() int64 {
    50  	return int64(len(b))
    51  }
    52  
    53  func (b ByteArray) Clone() PipelineEvent {
    54  	return b
    55  }